Skip to content

Commit

Permalink
Add limit to avoid accidental infinite loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
nurse committed Apr 15, 2012
1 parent 20e452f commit e582507
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/thread/shared/wakeup.rb
Expand Up @@ -21,12 +21,12 @@

exit_loop = true

Thread.pass while t.status and t.status != "sleep"
10.times { sleep 0.1 if t.status and t.status != "sleep" }
after_sleep1.should == false # t should be blocked on the first sleep
t.send(@method)

Thread.pass while after_sleep1 != true
Thread.pass while t.status and t.status != "sleep"
10.times { sleep 0.1 if after_sleep1 != true }
10.times { sleep 0.1 if t.status and t.status != "sleep" }
after_sleep2.should == false # t should be blocked on the second sleep
t.send(@method)

Expand Down

0 comments on commit e582507

Please sign in to comment.