Skip to content

Commit

Permalink
fix race condition in spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Oct 27, 2011
1 parent a28212b commit 33315ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/lock_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def synchronize(&block)
end end


it 'locks for other threads' do it 'locks for other threads' do
a = Thread.new { synchronize { sleep(0.1) and track << :first } } a = Thread.new { synchronize { sleep(0.2) and track << :first } }

sleep 0.1
b = Thread.new { synchronize { track << :second } } b = Thread.new { synchronize { track << :second } }


a.join a.join
Expand Down

0 comments on commit 33315ee

Please sign in to comment.