diff options
author | Jonathan Chambers <joncham@gmail.com> | 2020-07-28 21:34:16 +0300 |
---|---|---|
committer | Dharmendra Tomar <dtomar@rythmos.com> | 2020-10-22 15:10:04 +0300 |
commit | 42b9a77d36a2fa89d2074f42a2c66bf528d5608a (patch) | |
tree | 6339b7c4f54febe59502202ba2883e389ad380f0 | |
parent | 50b55f29ee4783dd5cc01a975e5bcdf8703cb1ee (diff) |
Add loop to handle abort error like in suspend logic.unity-2018.4-mbe
-rw-r--r-- | darwin_stop_world.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c index fa3e49ea..262ac949 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); |