[sgen] Remove an incorrect assertion in the workers code and explain.
authorMark Probst <mark.probst@gmail.com>
Mon, 7 Mar 2011 23:30:42 +0000 (00:30 +0100)
committerMark Probst <mark.probst@gmail.com>
Tue, 8 Mar 2011 00:02:41 +0000 (01:02 +0100)
mono/metadata/sgen-workers.c

index f2d1394e1c18b49db377ed877578f06d8094ff7a..c5e40728e51e7123cd48f8a1d26d4bdb762887ea 100644 (file)
@@ -448,8 +448,17 @@ workers_join (void)
 
        g_assert (workers_gc_in_progress);
        workers_gc_in_progress = FALSE;
-       if (workers_num_waiting == workers_num)
+       if (workers_num_waiting == workers_num) {
+               /*
+                * All the workers might have shut down at this point
+                * and posted the done semaphore but we don't know it
+                * yet.  It's not a big deal to wake them up again -
+                * they'll just do one iteration of their loop trying to
+                * find something to do and then go back to waiting
+                * again.
+                */
                workers_wake_up_all ();
+       }
        MONO_SEM_WAIT (&workers_done_sem);
        workers_marking = FALSE;
 
@@ -459,7 +468,6 @@ workers_join (void)
        }
 
        g_assert (workers_done_posted);
-       g_assert (workers_num_waiting == workers_num);
 
        g_assert (!workers_gc_thread_data.stealable_stack_fill);
        g_assert (gray_object_queue_is_empty (&workers_gc_thread_data.private_gray_queue));