]> 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>
Fri, 17 Nov 2017 08:07:03 +0000 (11:07 +0300)
commitd9df01a6829fac03bb35469895b17c1ab5adb828
treef0586903060c98eb3fcf59ae4bb6b320248d3604
parent8a6343236708bd31f4371b4ce68438433c72ffb1
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