summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
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 f3831a7425..88f834c550 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