aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index bf045a44ea..8e8d8fbdfe 100644
--- a/thread.c
+++ b/thread.c
@@ -629,7 +629,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
/* delete self other than main thread from living_threads */
rb_vm_living_threads_remove(th->vm, th);
- if (rb_thread_alone()) {
+ if (main_th->status == THREAD_KILLED && rb_thread_alone()) {
/* I'm last thread. wake up main thread from rb_thread_terminate_all */
rb_threadptr_interrupt(main_th);
}