Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@devhero
Created July 2, 2015 08:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devhero/0dea3e0a14989435a72d to your computer and use it in GitHub Desktop.
Save devhero/0dea3e0a14989435a72d to your computer and use it in GitHub Desktop.
Ruby wait for all threads finish
http://stackoverflow.com/questions/6241384/how-do-i-manage-ruby-threads-so-they-finish-all-their-work
require 'thread'
require 'thwait'
threads = []
threads << Thread.new { }
threads << Thread.new { }
ThreadsWait.all_waits(*threads)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment