summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/thread.c b/thread.c
index c9471717e0f..33d649b389f 100644
--- a/thread.c
+++ b/thread.c
@@ -378,28 +378,19 @@ rb_thread_terminate_all(void)
/* unlock all locking mutexes */
rb_threadptr_unlock_all_locking_mutexes(th);
-
vm->inhibit_thread_creation = 1;
- retry:
- thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
- st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
-
while (!rb_thread_alone()) {
int state;
+ thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
+ st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
- PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
- th = GET_THREAD();
+ TH_PUSH_TAG(th);
+ if ((state = TH_EXEC_TAG()) == 0) {
native_sleep(th, 0);
RUBY_VM_CHECK_INTS_BLOCKING(th);
}
- POP_TAG();
-
- /* broadcast eTerminateSignal again if Ctrl-C was pressed. */
- if (state && rb_obj_is_kind_of(GET_THREAD()->errinfo, rb_eInterrupt)) {
- goto retry;
- }
+ TH_POP_TAG();
}
}