]> 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>
Fri, 1 Dec 2017 16:38:02 +0000 (19:38 +0300)
commit66ae55e3f1f7172bfda3379bde6cf47d47d6f38c
tree1c1ced1e08ecd7c49af417daa079db56d86c2dc1
parent613ec90c8ea2a31d26c90bf5d3dd8a86329d211a
Fix data race in do_local_mark when comparing active_count to helper_count

* 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