Avoid potential data race during GC_dump execution
authorIvan Maidanski <ivmai@mail.ru>
Tue, 10 Apr 2018 08:48:51 +0000 (11:48 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 10 Apr 2018 08:48:51 +0000 (11:48 +0300)
commit36c6c7f25960ecec135d70a5ad4df01b0551e773
treed6de87db9263da95f1bfdd90ddca12c140e6eef6
parent0248b068ec9f3adfafa55095c20d552d2d9e79d4
Avoid potential data race during GC_dump execution

* include/gc.h (GC_dump): Separate declaration from GC_dump_named; add
comment that it acquires the lock.
* include/gc.h (GC_dump_named): Refine comment (add note that the lock
is not acquired by this function).
* include/private/gc_priv.h (GC_dump): Remove commented out declaration.
* include/private/gc_priv.h [!NO_DEBUGGING] (COND_DUMP): Call
GC_dump_named(NULL) instead of GC_dump().
* misc.c (GC_init) [GC_ASSERTIONS && GC_ALWAYS_MULTITHREADED]: Call
COND_DUMP while holding the allocation lock.
* misc.c [!NO_DEBUGGING] (GC_dump): Place LOCK/UNLOCK around
GC_dump_named() call.
include/gc.h
include/private/gc_priv.h
misc.c