Skip to content

Instantly share code, notes, and snippets.

@haileys
Last active January 2, 2016 22:49
Show Gist options
  • Save haileys/8372006 to your computer and use it in GitHub Desktop.
Save haileys/8372006 to your computer and use it in GitHub Desktop.
require "thread"
q = SizedQueue.new(1)
Thread.start do
q << "foo"
q << "bar"
end
p q.deq
p q.deq
# 1.9.3:
#
# "foo"
# "bar"
#
# 2.0.0:
#
# "foo"
# "bar"
#
# 2.1.0:
#
# "foo"
# szqueue.rb:11:in `pop': No live threads left. Deadlock? (fatal)
# from szqueue.rb:11:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment