From: Ivan Maidanski Date: Thu, 28 Dec 2017 08:18:25 +0000 (+0300) Subject: Do not call sem_getvalue in stop_world if one thread exists X-Git-Tag: v8.0.0~434 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62d2d77df3e8da9760f82e327ee95ded94075073;p=platform%2Fupstream%2Flibgc.git Do not call sem_getvalue in stop_world if one thread exists * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL] (GC_stop_world): Do not call sem_getvalue() if n_live_threads is zero (matters only if GC_retry_signals). --- diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 6e9f406..bda842c 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -808,7 +808,7 @@ GC_INNER void GC_stop_world(void) AO_store_release(&GC_world_is_stopped, TRUE); n_live_threads = GC_suspend_all(); - if (GC_retry_signals) { + if (GC_retry_signals && n_live_threads > 0) { unsigned long wait_usecs = 0; /* Total wait since retry. */ # define WAIT_UNIT 3000 # define RETRY_INTERVAL 100000