From: Ivan Maidanski Date: Fri, 27 Jul 2018 10:01:19 +0000 (+0300) Subject: Fix suspend_thread_list in case of thread_suspend is interrupted X-Git-Tag: v8.0.0~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96b7ac0ab5f783411a29fbbb24ba61aa598a493d;p=gc Fix suspend_thread_list in case of thread_suspend is interrupted (fix of commit e8cdc7c) * darwin_stop_world.c [!GC_NO_THREADS_DISCOVERY] (GC_suspend_thread_list): Retry thread_suspend if failed with KERN_ABORTED. --- diff --git a/darwin_stop_world.c b/darwin_stop_world.c index fe04a088..e59339c9 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -536,7 +536,9 @@ STATIC GC_bool GC_suspend_thread_list(thread_act_array_t act_list, int count, # ifdef DEBUG_THREADS GC_log_printf("Suspending %p\n", (void *)(word)thread); # endif - kern_result = thread_suspend(thread); + do { + kern_result = thread_suspend(thread); + } while (kern_result == KERN_ABORTED); if (kern_result != KERN_SUCCESS) { /* The thread may have quit since the thread_threads() call we */ /* mark already suspended so it's not dealt with anymore later. */