summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-17 20:43:27 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-17 20:43:27 +0000
commit9014917a5786036d57d826a12e9e7f644d354443 (patch)
tree588add05df5ef0ed0190c61a85093e564096c033 /lib
parente41eccf1195453120e28a4294380fb66a7dd8676 (diff)
* lib/thread.rb: rescue ThreadError in case the thread is dead
just before calling Thread#run. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/thread.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index 7b1933f6b2..0537c78650 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -74,7 +74,10 @@ class Mutex
retry
end
Thread.critical = false
- t.run if t
+ begin
+ t.run if t
+ rescue ThreadError
+ end
self
end
@@ -160,7 +163,10 @@ class Queue
ensure
Thread.critical = false
end
- t.run if t
+ begin
+ t.run if t
+ rescue ThreadError
+ end
end
def enq(obj)
push(obj)
@@ -262,7 +268,10 @@ class SizedQueue<Queue
ensure
Thread.critical = false
end
- t.run if t
+ begin
+ t.run if t
+ rescue ThreadError
+ end
end
retval
end