@@ -30,6 +30,7 @@ module Concurrent
30
30
it 'triggers the event' do
31
31
latch = CountDownLatch . new ( 1 )
32
32
Thread . new { subject . wait . tap { latch . count_down } }
33
+ sleep ( 0.1 )
33
34
subject . set
34
35
latch . wait ( 1 ) . should be_true
35
36
end
@@ -131,7 +132,7 @@ module Concurrent
131
132
subject . reset
132
133
latch = CountDownLatch . new ( 1 )
133
134
subject . set
134
- Thread . new { subject . wait ( 1000 ) . tap { latch . count_down } }
135
+ Thread . new { subject . wait ( 1000 ) ; latch . count_down }
135
136
latch . wait ( 0.1 ) . should be_true
136
137
end
137
138
@@ -152,7 +153,7 @@ module Concurrent
152
153
it 'stops waiting when the timer expires' do
153
154
subject . reset
154
155
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 }
156
157
latch . wait ( 0.1 ) . should be_false
157
158
latch . wait . should be_true
158
159
end
@@ -203,7 +204,7 @@ def subject.simulate_spurious_wake_up
203
204
204
205
it 'should resist to spurious wake ups with timeout' do
205
206
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 }
207
208
208
209
sleep ( 0.1 )
209
210
subject . simulate_spurious_wake_up
0 commit comments