summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-05-20 09:38:01 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-05-20 09:38:01 +0300
commit1b4e5168adb06260bb9c439816a05ddb861dd7e0 (patch)
treeaf8712169fc885496eb122bf1c21db99fa4b037b /tests
parentaf2b607c4ef65f828c5acb8027eada47cf72a5fc (diff)
downloadbdwgc-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 'tests')
-rw-r--r--tests/gctest.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/gctest.c b/tests/gctest.c
index 11235121..717873d2 100644
--- a/tests/gctest.c
+++ b/tests/gctest.c
@@ -1601,12 +1601,10 @@ void run_one_test(void)
if (print_stats)
GC_log_printf("Started a child process, pid= %ld\n",
(long)child_pid);
-# ifdef THREADS
-# ifdef PARALLEL_MARK
- GC_gcollect(); /* no parallel markers */
-# endif
- GC_start_mark_threads();
+# ifdef PARALLEL_MARK
+ GC_gcollect(); /* no parallel markers */
# endif
+ GC_start_mark_threads();
GC_gcollect();
# ifdef THREADS
/* Skip "Premature finalization" check in the */