@@ -30,6 +30,7 @@ module Concurrent
3030 it 'triggers the event' do
3131 latch = CountDownLatch . new ( 1 )
3232 Thread . new { subject . wait . tap { latch . count_down } }
33+ sleep ( 0.1 )
3334 subject . set
3435 latch . wait ( 1 ) . should be_true
3536 end
@@ -131,7 +132,7 @@ module Concurrent
131132 subject . reset
132133 latch = CountDownLatch . new ( 1 )
133134 subject . set
134- Thread . new { subject . wait ( 1000 ) . tap { latch . count_down } }
135+ Thread . new { subject . wait ( 1000 ) ; latch . count_down }
135136 latch . wait ( 0.1 ) . should be_true
136137 end
137138
@@ -152,7 +153,7 @@ module Concurrent
152153 it 'stops waiting when the timer expires' do
153154 subject . reset
154155 latch = CountDownLatch . new ( 1 )
155- Thread . new { subject . wait ( 0.2 ) . tap { latch . count_down } }
156+ Thread . new { subject . wait ( 0.2 ) ; latch . count_down }
156157 latch . wait ( 0.1 ) . should be_false
157158 latch . wait . should be_true
158159 end
@@ -203,7 +204,7 @@ def subject.simulate_spurious_wake_up
203204
204205 it 'should resist to spurious wake ups with timeout' do
205206 latch = CountDownLatch . new ( 1 )
206- Thread . new { subject . wait ( 0.3 ) . tap { latch . count_down } }
207+ Thread . new { subject . wait ( 0.3 ) ; latch . count_down }
207208
208209 sleep ( 0.1 )
209210 subject . simulate_spurious_wake_up
0 commit comments