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

ruby-changes:14053

From: nobu <ko1@a...>
Date: Fri, 20 Nov 2009 04:49:49 +0900 (JST)
Subject: [ruby-changes:14053] Ruby:r25864 (mvm): * thread.c (rb_queue_shift_wait): fixed the case of no-timeout.

nobu	2009-11-20 04:38:54 +0900 (Fri, 20 Nov 2009)

  New Revision: 25864

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

  Log:
    * thread.c (rb_queue_shift_wait): fixed the case of no-timeout.

  Modified files:
    branches/mvm/ChangeLog
    branches/mvm/thread.c
    branches/mvm/version.h

Index: mvm/ChangeLog
===================================================================
--- mvm/ChangeLog	(revision 25863)
+++ mvm/ChangeLog	(revision 25864)
@@ -1,3 +1,7 @@
+Fri Nov 20 04:38:44 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread.c (rb_queue_shift_wait): fixed the case of no-timeout.
+
 Tue Nov 17 12:00:56 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* vm_core.h (rb_vm_t): manage references from other VMs.
Index: mvm/thread.c
===================================================================
--- mvm/thread.c	(revision 25863)
+++ mvm/thread.c	(revision 25864)
@@ -1172,6 +1172,9 @@
 	((que->head = e->next) != 0 || \
 	 (que->tail = &que->head, 1)))
 
+#define COND_WAIT(wt, lk, tv) \
+    (tv ?  : native_cond_wait(wt, lk))
+
 int
 rb_queue_shift_wait(rb_queue_t *que, void **value, const struct timeval *tv)
 {
@@ -1183,15 +1186,18 @@
 	add_tv(&to, tv);
     }
     ruby_native_thread_lock(&que->lock);
-    while (!QUEUE_SHIFT(e, que) &&
-	   native_cond_timedwait(&que->wait, &que->lock, tv) == ETIMEDOUT) {
+    while (!QUEUE_SHIFT(e, que)) {
 	if (tv) {
+	    if (native_cond_timedwait(&que->wait, &que->lock, tv) != ETIMEDOUT) break;
 	    if (QUEUE_SHIFT(e, que)) break;
 	    td = to;
 	    getclockofday(&tvn);
 	    if (!subtract_tv(&td, &tvn)) break;
 	    tv = &td;
 	}
+	else {
+	    native_cond_wait(&que->wait, &que->lock);
+	}
     }
     ruby_native_thread_unlock(&que->lock);
     if (!e) {
Index: mvm/version.h
===================================================================
--- mvm/version.h	(revision 25863)
+++ mvm/version.h	(revision 25864)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_RELEASE_DATE "2009-11-17"
+#define RUBY_RELEASE_DATE "2009-11-20"
 #define RUBY_PATCHLEVEL -1
 #define RUBY_BRANCH_NAME "mvm"
 
@@ -8,7 +8,7 @@
 #define RUBY_VERSION_TEENY 1
 #define RUBY_RELEASE_YEAR 2009
 #define RUBY_RELEASE_MONTH 11
-#define RUBY_RELEASE_DAY 17
+#define RUBY_RELEASE_DAY 20
 
 #include "ruby/version.h"
 

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

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