Created
August 25, 2014 10:29
-
-
Save domgetter/7ca5caaa62d16f89fdf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
threads = [] | |
threads << Thread.new do | |
Thread.stop | |
puts "(first) I started up again!" | |
end | |
threads << Thread.new do | |
Thread.stop | |
puts "(second) I started up again!" | |
end | |
last_pid = "" | |
threads.each do |thread| | |
last_pid = fork do | |
thread.run | |
end | |
end | |
Process.wait last_pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment