Skip to content

Instantly share code, notes, and snippets.

@domgetter
Created August 25, 2014 10:29
Show Gist options
  • Save domgetter/7ca5caaa62d16f89fdf5 to your computer and use it in GitHub Desktop.
Save domgetter/7ca5caaa62d16f89fdf5 to your computer and use it in GitHub Desktop.
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