From c2e05dd1f2312e732d6cdcfcdf266b0dec9ebab4 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 7 Jun 2017 10:18:28 +0300 Subject: [PATCH] Eliminate 'unused variable' compiler warning in remove_all_threads_but_me (fix commit 0fc61f2) * pthread_support.c [CAN_HANDLE_FORK] (GC_remove_all_threads_but_me): Declare "res" local variable only if THREAD_LOCAL_ALLOC and not USE_CUSTOM_SPECIFIC. --- pthread_support.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pthread_support.c b/pthread_support.c index 37c6e0bb..3d688ff9 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -673,12 +673,16 @@ STATIC void GC_remove_all_threads_but_me(void) me -> kernel_id = gettid(); # endif # if defined(THREAD_LOCAL_ALLOC) && !defined(USE_CUSTOM_SPECIFIC) + { + int res; + /* Some TLS implementations might be not fork-friendly, so */ /* we re-assign thread-local pointer to 'tlfs' for safety */ /* instead of the assertion check (again, it is OK to call */ /* GC_destroy_thread_local and GC_free_internal before). */ if (GC_setspecific(GC_thread_key, &me->tlfs) != 0) ABORT("GC_setspecific failed (in child)"); + } # endif } else { # ifdef THREAD_LOCAL_ALLOC -- 2.50.1