]> granicus.if.org Git - gc/commit
Eliminate TSan warning about data race when accessing GC_debugging_started
authorIvan Maidanski <ivmai@mail.ru>
Fri, 17 Nov 2017 08:07:03 +0000 (11:07 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 16 Apr 2018 08:25:05 +0000 (11:25 +0300)
commit7881f44ef5412e7cb4a208614e279bde48163a35
tree8b858eda0bb8b221c284e8a67629a4506246cf10
parentb6b7dbb9db83cf7b536f7d8546e30ba01d4ef41f
Eliminate TSan warning about data race when accessing GC_debugging_started

Now GC_debugging_started variable is double-checked with the allocation
lock held before calling GC_start_debugging_inner.

* dbg_mlc.c (GC_start_debugging_inner): Define as GC_INNER (instead of
STATIC).
* dbg_mlc.c [THREADS] (GC_start_debugging): Define as STATIC; do not
call GC_start_debugging_inner() if GC_debugging_started.
* dbg_mlc.c [!THREADS] (GC_start_debugging): Define as macro (redirect
to GC_start_debugging_inner).
* gcj_mlc.c (GC_debug_gcj_malloc): Call GC_start_debugging_inner
(holding the lock) instead of GC_start_debugging.
* include/private/gc_priv.h (GC_start_debugging): Rename to
GC_start_debugging_inner; improve usage comment.
dbg_mlc.c
gcj_mlc.c
include/private/gc_priv.h