Skip to content

Instantly share code, notes, and snippets.

@nahi
Created June 8, 2010 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahi/430066 to your computer and use it in GitHub Desktop.
Save nahi/430066 to your computer and use it in GitHub Desktop.
require 'thread'
q = Queue.new
t1 = Thread.new {
p [:t1, q.pop]
q.push(:t1)
}
q.push(:main)
p [:main, q.pop]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment