summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/thread.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7677a7010f..91c0e417f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon May 10 02:07:20 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * lib/thread.rb (ConditionVariable#wait): ensure to remove the current
+ thread from waiters. [ruby-core:29835]
+
Mon May 10 00:54:15 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/io/console/console.c (console_set_raw): new method.
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