我希望多个线程同时触发。
10.times do
Thread.new do
sleep rand(5) # Initialize all the stuff
wait_for_all_other_threads # Wait for other threads to initialize their stuff
fire! # Go.
end
end
我将如何实施wait_for_all_other_threads,以便他们fire!同时进行?