summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index bfd0267126..56e9db8170 100644
--- a/eval.c
+++ b/eval.c
@@ -8211,6 +8211,11 @@ rb_thread_schedule()
if (!next) {
/* raise fatal error to main thread */
curr_thread->node = ruby_current_node;
+ if (curr->next == curr) {
+ TRAP_BEG;
+ pause();
+ TRAP_END;
+ }
FOREACH_THREAD_FROM(curr, th) {
fprintf(stderr, "deadlock 0x%lx: %s:",
th->thread, thread_status_name(th->status));