From 60d0e0b7db68c3ca771829d4fd1b991ac9448c9c Mon Sep 17 00:00:00 2001 From: Jonathan Chambers Date: Tue, 28 Jul 2020 14:34:16 -0400 Subject: Add loop to handle abort error like in suspend logic. --- darwin_stop_world.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 525f3158..a132cec2 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -196,10 +196,12 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, /* else */ { mach_msg_type_number_t thread_state_count = GC_MACH_THREAD_STATE_COUNT; - /* Get the thread state (registers, etc) */ - kern_result = thread_get_state(thread, GC_MACH_THREAD_STATE, + do { + /* Get the thread state (registers, etc) */ + kern_result = thread_get_state(thread, GC_MACH_THREAD_STATE, (natural_t *)&state, &thread_state_count); + } while (kern_result == KERN_ABORTED); } # ifdef DEBUG_THREADS GC_log_printf("thread_get_state returns value = %d\n", kern_result); -- cgit v1.2.3