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 | 9c7707629608304a2eaf674a72af16c95ebc4f52 (patch) | |
tree | 31f8b0c15d6014203f1f7c0f4b37bae160b75381 /bootstraptest/test_thread.rb | |
parent | 62aa7aae51004bddf9e0c9c6bcdf2d6fe88840e8 (diff) | |
download | ruby-9c7707629608304a2eaf674a72af16c95ebc4f52.tar.gz |
* thread.c (thread_join): remove the current thread from the join list
of the target thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_thread.rb')
-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 43bb2fe772..873e955291 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 +} |