[sgen] Only flush binary protocol buffers when world is stopped.
authorMark Probst <mark.probst@gmail.com>
Fri, 8 May 2015 18:32:08 +0000 (11:32 -0700)
committerMark Probst <mark.probst@gmail.com>
Fri, 8 May 2015 18:32:54 +0000 (11:32 -0700)
mono/sgen/sgen-protocol-def.h
mono/sgen/sgen-protocol.c

index 0df783a477af9389add8307eea5e30325ecae6b2..c546bac45c895b4aa2f07b9d35b47e5f31845a12 100644 (file)
@@ -1,5 +1,4 @@
 BEGIN_PROTOCOL_ENTRY3 (binary_protocol_collection_requested, TYPE_INT, generation, TYPE_SIZE, requested_size, TYPE_BOOL, force)
-FLUSH ()
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
 MATCH_INDEX (BINARY_PROTOCOL_MATCH)
index 1b55b8890f46692cee1dd699794ee776f03f0529..cb512fedf4fb503bc711709d5237d3134544dad0 100644 (file)
@@ -228,6 +228,13 @@ binary_protocol_check_file_overflow (void)
 }
 #endif
 
+/*
+ * Flushing buffers takes an exclusive lock, so it must only be done when the world is
+ * stopped, otherwise we might end up with a deadlock because a stopped thread owns the
+ * lock.
+ *
+ * The protocol entries that do flush have `FLUSH()` in their definition.
+ */
 void
 binary_protocol_flush_buffers (gboolean force)
 {