Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Thread#wakeup

() -> ::Thread
thr.wakeup → thr

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!"
See also #value #to_s also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0