]> granicus.if.org Git - gc/commitdiff
Fix assertion violation in GC_wait_builder called from start_mark_threads
authorIvan Maidanski <ivmai@mail.ru>
Tue, 21 Jun 2016 20:38:23 +0000 (23:38 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 23 Jun 2016 07:53:37 +0000 (10:53 +0300)
(Apply commit d02ea97 from 'master' branch.)

* mark.c (GC_wait_for_markers_init): Surround function body with
DISABLE/RESTORE_CANCEL.

Conflicts:
* include/private/gc_priv.h
* pthread_support.c
* win32_threads.c

mark.c

diff --git a/mark.c b/mark.c
index eb8efc790d5330365dc158724cb20f1ffd1d9301..e23a79660bb4a469bccc01589a5572171d0aee35 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -914,10 +914,12 @@ GC_INNER word GC_mark_no = 0;
 GC_INNER void GC_wait_for_markers_init(void)
 {
   word count;
+  IF_CANCEL(int cancel_state;)
 
   if (GC_markers_m1 == 0)
     return;
 
+  DISABLE_CANCEL(cancel_state);
   /* Reuse marker lock and builders count to synchronize        */
   /* marker threads startup.                                    */
   GC_acquire_mark_lock();
@@ -926,6 +928,7 @@ GC_INNER void GC_wait_for_markers_init(void)
   GC_release_mark_lock();
   if (count != 0)
     GC_wait_for_reclaim();
+  RESTORE_CANCEL(cancel_state);
 }
 
 /* Steal mark stack entries starting at mse low into mark stack local   */