diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 04:13:01 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 04:13:01 +0000 |
| commit | 1bee8a8b459baf3862e38389a8b49b30f5f0bae1 (patch) | |
| tree | 31f8b0c15d6014203f1f7c0f4b37bae160b75381 /bootstraptest | |
| parent | 611e0e06a39cd5e81ec2ff3bdf61b47f0d7fc491 (diff) | |
| download | ruby-1bee8a8b459baf3862e38389a8b49b30f5f0bae1.tar.gz ruby-1bee8a8b459baf3862e38389a8b49b30f5f0bae1.tar.xz ruby-1bee8a8b459baf3862e38389a8b49b30f5f0bae1.zip | |
* thread.c (thread_join): remove the current thread from the join list
of the target thread.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
| -rw-r--r-- | bootstraptest/test_thread.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb index 43bb2fe77..873e95529 100644 --- a/bootstraptest/test_thread.rb +++ b/bootstraptest/test_thread.rb @@ -213,3 +213,19 @@ assert_equal 'true', %{ true end } + +assert_finish 3, %{ + th = Thread.new {sleep 2} + th.join(1) + th.join +} + +assert_finish 3, %{ + require 'timeout' + th = Thread.new {sleep 2} + begin + Timeout.timeout(1) {th.join} + rescue Timeout::Error + end + th.join +} |
