diff options
author | Jonathan Chambers <joncham@gmail.com> | 2020-08-04 18:17:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 18:17:27 +0300 |
commit | 0eb53e4b3d45d17e262736945b3d2bf63b36ad6f (patch) | |
tree | cd2d4d149b8c47cd633ca5712cca12eb0f766884 | |
parent | 16a11ba8943d867693a4b59806b597f98040577a (diff) | |
parent | 60d0e0b7db68c3ca771829d4fd1b991ac9448c9c (diff) |
Merge pull request #60 from Unity-Technologies/unity-master-darwin-stop-world-fix
Add loop to handle abort error like in suspend logic.
-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 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); |