From 9c7707629608304a2eaf674a72af16c95ebc4f52 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 22 Apr 2008 04:13:01 +0000 Subject: * 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 --- bootstraptest/test_thread.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bootstraptest/test_thread.rb') 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 +} -- cgit v1.2.3