summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-12 09:07:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-12 09:07:57 +0000
commit9da4f78db46764be6dae5e7e83ff48cbecb3fb23 (patch)
treec0805e6c95d6396e28e6129d88905c4dee085f4e /lib/thread.rb
parent014f2164ed7031a1c31604b290d2ab0cf1deacdc (diff)
2000-05-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/thread.rb')
-rw-r--r--lib/thread.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index 20ce6aef5d..a0e6967a28 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -157,8 +157,10 @@ class Queue
t.wakeup if t
rescue ThreadError
retry
+ ensure
+ Thread.critical = false
end
- Thread.critical = false
+ t.run if t
end
alias enq push
@@ -250,10 +252,13 @@ class SizedQueue<Queue
if @que.length < @max
begin
t = @queue_wait.shift
- t.run if t
+ t.wakeup if t
rescue ThreadError
retry
+ ensure
+ Thread.critical = false
end
+ t.run if t
end
super
end