End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Thread#wakeup
thr.wakeup → thr
thread.c
View on GitHub ↗
VALUE
rb_thread_wakeup(VALUE thread)
{
if (!RTEST(rb_thread_wakeup_alive(thread))) {
rb_raise(rb_eThreadError, "killed thread");
}
return thread;
}
Marks a given thread as eligible for scheduling, however it may still remain blocked on I/O.
Note: This does not invoke the scheduler, see run for more information.
Example
c = Thread.new { Thread.stop; puts "hey!" } sleep 0.1 while c.status!='sleep' c.wakeup c.join #=> "hey!"