diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2020-02-11 10:56:48 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2020-02-11 10:56:48 +0300 |
commit | 03a3fbbdd5cff52360facdfcc9f86adbdc111245 (patch) | |
tree | 30e249d66db942c9866986f97e16f0cd752da3fd /misc.c | |
parent | 294f0b8eb279f9d0517bfa39decaf7ac4aaa3b5d (diff) | |
download | bdwgc-03a3fbbdd5cff52360facdfcc9f86adbdc111245.tar.gz |
Call GC_thr_init only once
(code refactoring)
GC_thr_init() is now called only if GC_thr_initialized;
"if(GC_thr_initialized)return" statement is removed from GC_thr_init.
* misc.c [GC_PTHREADS || GC_WIN32_THREADS] (GC_init): Do not call
GC_thr_init() if GC_thr_initialized.
* pthread_support.c (GC_thr_init): Remove return if GC_thr_initialized;
add GC_ASSERT that GC_thr_initialized is false.
* win32_threads.c (GC_thr_init): Likewise.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1304,7 +1304,7 @@ GC_API void GC_CALL GC_init(void) # endif GC_is_initialized = TRUE; # if defined(GC_PTHREADS) || defined(GC_WIN32_THREADS) - GC_thr_init(); + if (!GC_thr_initialized) GC_thr_init(); # ifdef PARALLEL_MARK /* Actually start helper threads. */ # if defined(GC_ASSERTIONS) && defined(GC_ALWAYS_MULTITHREADED) |