aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 57c5752eb0..eebe1a2c61 100644
--- a/eval.c
+++ b/eval.c
@@ -10971,10 +10971,13 @@ rb_thread_sleep(sec)
void
rb_thread_sleep_forever()
{
+ int thr_critical = rb_thread_critical;
if (curr_thread == curr_thread->next ||
curr_thread->status == THREAD_TO_KILL) {
+ rb_thread_critical = Qtrue;
TRAP_BEG;
pause();
+ rb_thread_critical = thr_critical;
TRAP_END;
return;
}