diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-07-27 13:01:19 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-07-27 13:06:08 +0300 |
commit | 96b7ac0ab5f783411a29fbbb24ba61aa598a493d (patch) | |
tree | f5f4f4b2c17eed1140f8a327d3cb26c31335d409 /darwin_stop_world.c | |
parent | e8cdc7c2dbc0edeb185bf7438f1982c6bc74a82e (diff) | |
download | bdwgc-96b7ac0ab5f783411a29fbbb24ba61aa598a493d.tar.gz |
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.
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r-- | darwin_stop_world.c | 4 |
1 files changed, 3 insertions, 1 deletions
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. */ |