summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-09 17:10:18 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-09 17:10:18 +0000
commitf4053cf5554deb0051aabfc90180784236f1f25b (patch)
treef5991bb3b01678ca67c0820bad4e94c4e52da19f /lib/thread.rb
parentcb61fcb98813b30e94b3c7507f00433b845a1e66 (diff)
* lib/thread.rb (ConditionVariable#wait): ensure to remove the current
thread from waiters. [ruby-core:29835] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/thread.rb')
-rw-r--r--lib/thread.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index f3831a74255..88f834c5504 100644
--- a/lib/thread.rb
+++ b/lib/thread.rb
@@ -69,6 +69,10 @@ class ConditionVariable
@waiters.push(Thread.current)
end
mutex.sleep timeout
+ ensure
+ @waiters_mutex.synchronize do
+ @waiters.delete(Thread.current)
+ end
end
self
end