Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Explicitly pass the thread.

  • Loading branch information...
commit 4135db91c316e3993f86316a3772120f8969b389 1 parent 816aa58
@nurse nurse authored
Showing with 15 additions and 13 deletions.
  1. +15 −13 core/thread/alive_spec.rb
View
28 core/thread/alive_spec.rb
@@ -38,21 +38,23 @@
ThreadSpecs.status_of_dying_sleeping_thread.alive?.should == true
end
- it "return true for a killed but still running thread" do
- exit = false
- t = Thread.new do
- begin
- sleep
- ensure
- true while !exit # spin until told to exit
+ ruby_version_is '1.9' do
+ it "return true for a killed but still running thread" do
+ exit = false
+ t = Thread.new do
+ begin
+ sleep
+ ensure
+ Thread.pass until exit # Ruby 1.8 won't switch threads here
+ end
end
- end
- ThreadSpecs.spin_until_sleeping(t)
+ ThreadSpecs.spin_until_sleeping(t)
- t.kill
- t.alive?.should == true
- exit = true
- t.join
+ t.kill
+ t.alive?.should == true
+ exit = true
+ t.join
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.