Skip to content

Commit

Permalink
Improve Thread#wakeup spec
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jul 13, 2015
1 parent 68a1d95 commit 9888ee5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/ruby/core/thread/shared/wakeup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@

it "does not result in a deadlock" do
t = Thread.new do
1000.times {Thread.stop }
100.times { Thread.stop }
end

while(t.status != false) do
while t.status
begin
t.send(@method)
rescue ThreadError
Expand All @@ -49,7 +49,8 @@
Thread.pass
end

1.should == 1 # test succeeds if we reach here
t.status.should == false
t.join
end

it "raises a ThreadError when trying to wake up a dead thread" do
Expand Down

0 comments on commit 9888ee5

Please sign in to comment.