summaryrefslogtreecommitdiff
path: root/spec/ruby/library/conditionvariable/broadcast_spec.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-06 13:36:02 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-06 14:50:32 +0900
commit3d83e641b1a6e13e0e0a59c19536e1dde96891f4 (patch)
tree6bd0ac843934ea6daed121ea49b1d37bae85f4a0 /spec/ruby/library/conditionvariable/broadcast_spec.rb
parent34f8e75f9305b0da4ef1b0d4fe9ea3c3f31dcc22 (diff)
[ruby/spec] Check by Thread#stop?
Check if threads are stopped by Thread#stop? instead of the status name.
Diffstat (limited to 'spec/ruby/library/conditionvariable/broadcast_spec.rb')
-rw-r--r--spec/ruby/library/conditionvariable/broadcast_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/library/conditionvariable/broadcast_spec.rb b/spec/ruby/library/conditionvariable/broadcast_spec.rb
index a31a0443bd..1dccdf4895 100644
--- a/spec/ruby/library/conditionvariable/broadcast_spec.rb
+++ b/spec/ruby/library/conditionvariable/broadcast_spec.rb
@@ -22,7 +22,7 @@ describe "ConditionVariable#broadcast" do
# wait for m to acquire the mutex
Thread.pass until in_synchronize
# wait until th is sleeping (ie waiting)
- Thread.pass while th.status and th.status != "sleep"
+ Thread.pass until th.stop?
m.synchronize { cv.broadcast }.should == cv
@@ -50,7 +50,7 @@ describe "ConditionVariable#broadcast" do
# wait for all threads to acquire the mutex the first time
Thread.pass until m.synchronize { r1.size == threads.size }
# wait until all threads are sleeping (ie waiting)
- Thread.pass until threads.all? {|th| th.status == "sleep" }
+ Thread.pass until threads.all?(&:stop?)
r2.should be_empty
m.synchronize do