diff options
-rw-r--r-- | thread_sync.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/thread_sync.c b/thread_sync.c index 41df2dead9..748ccbd558 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -34,8 +34,10 @@ sync_wakeup(struct list_head *head, long max) } if (cur->th->status != THREAD_KILLED) { - rb_threadptr_interrupt(cur->th); - cur->th->status = THREAD_RUNNABLE; + if (cur->th->scheduler != Qnil) { + rb_threadptr_interrupt(cur->th); + cur->th->status = THREAD_RUNNABLE; + } if (--max == 0) return; } } |