Wake up a thread : wakeup « Threads « Ruby






Wake up a thread


t1 = Thread.new do
  Thread.stop
  puts "There is an emerald here."
end
t2 = Thread.new do
  Thread.stop
  puts "You're at Y2."
end

sleep 1
t1.wakeup
t2.run

 








Related examples in the same category

1.Wakeup main thread