[前][次][番号順一覧][スレッド一覧]

ruby-changes:15782

From: mame <ko1@a...>
Date: Mon, 10 May 2010 02:10:37 +0900 (JST)
Subject: [ruby-changes:15782] Ruby:r27711 (trunk): * lib/thread.rb (ConditionVariable#wait): ensure to remove the current

mame	2010-05-10 02:10:18 +0900 (Mon, 10 May 2010)

  New Revision: 27711

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27711

  Log:
    * lib/thread.rb (ConditionVariable#wait): ensure to remove the current
      thread from waiters.  [ruby-core:29835]

  Modified files:
    trunk/ChangeLog
    trunk/lib/thread.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27710)
+++ ChangeLog	(revision 27711)
@@ -1,3 +1,8 @@
+Mon May 10 02:07:20 2010  Yusuke Endoh  <mame@t...>
+
+	* 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@r...>
 
 	* ext/io/console/console.c (console_set_raw): new method.
Index: lib/thread.rb
===================================================================
--- lib/thread.rb	(revision 27710)
+++ lib/thread.rb	(revision 27711)
@@ -69,6 +69,10 @@
         @waiters.push(Thread.current)
       end
       mutex.sleep timeout
+    ensure
+      @waiters_mutex.synchronize do
+        @waiters.delete(Thread.current)
+      end
     end
     self
   end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]