From 66e6ff2b21c4d0c3a586724b65588d77a2a65908 Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Mon, 1 Feb 2016 18:10:23 +0200 Subject: [PATCH] [sgen] Add binary protocol entry for worker finish 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 | 5 +++++ mono/sgen/sgen-protocol-def.h | 7 +++++++ mono/sgen/sgen-workers.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/mono/metadata/sgen-client-mono.h b/mono/metadata/sgen-client-mono.h index b9bf15465ff..e66b1daf4dd 100644 --- a/mono/metadata/sgen-client-mono.h +++ b/mono/metadata/sgen-client-mono.h @@ -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); diff --git a/mono/sgen/sgen-protocol-def.h b/mono/sgen/sgen-protocol-def.h index b5bd3906ff9..fa08468d515 100644 --- a/mono/sgen/sgen-protocol-def.h +++ b/mono/sgen/sgen-protocol-def.h @@ -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 diff --git a/mono/sgen/sgen-workers.c b/mono/sgen/sgen-workers.c index 8f1af133129..f1212c658c4 100644 --- a/mono/sgen/sgen-workers.c +++ b/mono/sgen/sgen-workers.c @@ -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 -- 2.11.4.GIT