# File test/test_queue.rb, line 19 def test_push_pop_multi_thread spin_lock = true Thread.new{ while (spin_lock) # locked. end @queue.push(PseudoIO.new) } Thread.new{ while (spin_lock) # locked. end @queue.push(PseudoIO.new) } Thread.new{ while (spin_lock) # locked. end @queue.push(PseudoIO.new) } Thread.new{ while (spin_lock) # locked. end @queue.push(PseudoIO.new) } spin_lock = false assert_instance_of(PseudoIO, @queue.pop) assert_instance_of(PseudoIO, @queue.pop) assert_instance_of(PseudoIO, @queue.pop) assert_instance_of(PseudoIO, @queue.pop) end