]> granicus.if.org Git - gc/commit
Fix data race in do_local_mark when comparing active_count to helper_count
authorIvan Maidanski <ivmai@mail.ru>
Fri, 1 Dec 2017 16:38:02 +0000 (19:38 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 18 Dec 2017 07:21:22 +0000 (10:21 +0300)
commitec7134858590bad23809d9c7bca29cabd0e4230a
treeb9fd4d6059fac48e83ce1a97d75f1dbd5009e1b6
parentf2571e41752dac1bdfd8c455ee26331fb8a60014
Fix data race in do_local_mark when comparing active_count to helper_count
(Cherry-pick commit 66ae55e3 from 'master' branch.)

* mark.c [PARALLEL_MARK] (has_inactive_helpers): New static function
(which compares GC_active_count to GC_helper_count with the mark lock
held).
* mark.c [PARALLEL_MARK && GC_ASSERTIONS] (GC_do_local_mark): Remove
GC_acquire_mark_lock() with immediate GC_acquire_mark_unlock(); add
the appropriate comment to the function description instead.
* mark.c [PARALLEL_MARK] (GC_do_local_mark): Call has_inactive_helpers()
instead of GC_active_count<GC_helper_count; do not call
has_inactive_helpers() unless local_top>local_mark_stack+1.
mark.c