diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-05-20 09:38:01 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-05-20 09:38:01 +0300 |
commit | 1b4e5168adb06260bb9c439816a05ddb861dd7e0 (patch) | |
tree | af8712169fc885496eb122bf1c21db99fa4b037b /misc.c | |
parent | af2b607c4ef65f828c5acb8027eada47cf72a5fc (diff) | |
download | bdwgc-1b4e5168adb06260bb9c439816a05ddb861dd7e0.tar.gz |
Allow to start marker threads in child of single-threaded client
Now GC_start_mark_threads() is present even if the collector is
single-threaded (the function does nothing in this case).
* include/gc/gc.h (GC_start_mark_threads): Declare unconditionally
(i.e. even w/o GC_THREADS).
* misc.c (GC_start_mark_threads): Define unconditionally (no-op in
case of GC_THREADS is not defined).
* tests/gctest.c [!NO_TEST_HANDLE_FORK && !GC_THREADS] (run_one_test):
Call GC_start_mark_threads().
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1445,9 +1445,8 @@ GC_API void GC_CALL GC_enable_incremental(void) GC_init(); } -#if defined(THREADS) - GC_API void GC_CALL GC_start_mark_threads(void) - { +GC_API void GC_CALL GC_start_mark_threads(void) +{ # if defined(PARALLEL_MARK) && defined(CAN_HANDLE_FORK) \ && !defined(THREAD_SANITIZER) /* TSan does not support threads creation in the child process. */ @@ -1463,8 +1462,7 @@ GC_API void GC_CALL GC_enable_incremental(void) /* No action since parallel markers are disabled (or no POSIX fork). */ GC_ASSERT(I_DONT_HOLD_LOCK()); # endif - } -#endif +} GC_API void GC_CALL GC_deinit(void) { |