summaryrefslogtreecommitdiff
path: root/darwin_stop_world.c
diff options
context:
space:
mode:
authorJonathan Chambers <joncham@gmail.com>2018-07-24 16:46:52 -0400
committerIvan Maidanski <ivmai@mail.ru>2018-07-27 12:48:57 +0300
commite8cdc7c2dbc0edeb185bf7438f1982c6bc74a82e (patch)
tree1354b4d65b383a7a98644d203f4f7e6e0c3549a4 /darwin_stop_world.c
parent8d64dbd1079f94e1379eb2dfef0b90aef9574c85 (diff)
downloadbdwgc-e8cdc7c2dbc0edeb185bf7438f1982c6bc74a82e.tar.gz
Perform thread_suspend in loop as it may be interrupted (Darwin)
* darwin_stop_world.c (GC_stop_world): Retry thread_suspend() on KERN_ABORTED.
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r--darwin_stop_world.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c
index fd04fcd2..fe04a088 100644
--- a/darwin_stop_world.c
+++ b/darwin_stop_world.c
@@ -636,7 +636,9 @@ GC_INNER void GC_stop_world(void)
if ((p->flags & FINISHED) == 0 && !p->thread_blocked &&
p->stop_info.mach_thread != my_thread) {
- kern_result = thread_suspend(p->stop_info.mach_thread);
+ do {
+ kern_result = thread_suspend(p->stop_info.mach_thread);
+ } while (kern_result == KERN_ABORTED);
if (kern_result != KERN_SUCCESS)
ABORT("thread_suspend failed");
if (GC_on_thread_event)