mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Make Thread#join
non-blocking.
This commit is contained in:
parent
596173155a
commit
70f08f1eed
Notes:
git
2020-09-21 08:49:08 +09:00
7 changed files with 168 additions and 127 deletions
|
@ -19,8 +19,13 @@ describe "Thread#join" do
|
|||
t.join(0).should equal(t)
|
||||
t.join(0.0).should equal(t)
|
||||
t.join(nil).should equal(t)
|
||||
end
|
||||
|
||||
it "raises TypeError if the argument is not a valid timeout" do
|
||||
t = Thread.new {sleep}
|
||||
-> { t.join(:foo) }.should raise_error TypeError
|
||||
-> { t.join("bar") }.should raise_error TypeError
|
||||
t.kill
|
||||
end
|
||||
|
||||
it "returns nil if it is not finished when given a timeout" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue