[sgen] Add binary protocol entry for worker finish
authorVlad Brezae <brezaevlad@gmail.com>
Mon, 1 Feb 2016 16:10:23 +0000 (18:10 +0200)
committerVlad Brezae <brezaevlad@gmail.com>
Tue, 2 Feb 2016 00:19:55 +0000 (02:19 +0200)
This will allow us to detect actual concurrent M&S end and whether the concurrent M&S was forced to finish.

mono/metadata/sgen-client-mono.h
mono/sgen/sgen-protocol-def.h
mono/sgen/sgen-workers.c

index b9bf15465ffe627ab25f7335deb4f0993c764e1b..e66b1daf4ddf6447e6ad1d31b50691638df61d46 100644 (file)
@@ -690,6 +690,11 @@ sgen_client_binary_protocol_finish_gray_stack_end (long long timestamp, int gene
 {
 }
 
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_worker_finish (long long timestamp, gboolean forced)
+{
+}
+
 int sgen_thread_handshake (BOOL suspend);
 gboolean sgen_suspend_thread (SgenThreadInfo *info);
 gboolean sgen_resume_thread (SgenThreadInfo *info);
index b5bd3906ff9329cb6f31632697ba127c44b81373..fa08468d515ffd0acc9484b3f4216f49599078d4 100644 (file)
@@ -421,6 +421,13 @@ MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY
 
+BEGIN_PROTOCOL_ENTRY2 (binary_protocol_worker_finish, TYPE_LONGLONG, timestamp, TYPE_BOOL, forced)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (TRUE)
+MATCH_INDEX (BINARY_PROTOCOL_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY
+
 #undef BEGIN_PROTOCOL_ENTRY0
 #undef BEGIN_PROTOCOL_ENTRY1
 #undef BEGIN_PROTOCOL_ENTRY2
index 8f1af1331299b951daef97af52ceeb1c4d137bb7..f1212c658c4c755954fba3d3927e62742cfe836e 100644 (file)
@@ -123,6 +123,8 @@ worker_try_finish (void)
 
                /* We are the last thread to go to sleep. */
        } while (!set_state (old_state, STATE_NOT_WORKING));
+
+       binary_protocol_worker_finish (sgen_timestamp (), forced_stop);
 }
 
 void