summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index 69fc299fcd..b1a802b89c 100644
--- a/thread.c
+++ b/thread.c
@@ -524,13 +524,14 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
join_th = join_th->join_list_next;
}
+ thread_unlock_all_locking_mutexes(th);
+ if (th != main_th) rb_check_deadlock(th->vm);
+
if (!th->root_fiber) {
rb_thread_recycle_stack_release(th->stack);
th->stack = 0;
}
}
- thread_unlock_all_locking_mutexes(th);
- if (th != main_th) rb_check_deadlock(th->vm);
if (th->vm->main_thread == th) {
ruby_cleanup(state);
}