Mega Code Archive

 
Categories / Ruby / Threads
 

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