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

ruby-changes:8605

From: nobu <ko1@a...>
Date: Sat, 8 Nov 2008 01:42:45 +0900 (JST)
Subject: [ruby-changes:8605] Ruby:r20140 (trunk): * thread_pthread.c (native_cond_timedwait): returns error code.

nobu	2008-11-08 01:42:31 +0900 (Sat, 08 Nov 2008)

  New Revision: 20140

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

  Log:
    * thread_pthread.c (native_cond_timedwait): returns error code.
    * thread_pthread.c (thread_timer): typo fixed.

  Modified files:
    trunk/ChangeLog
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20139)
+++ ChangeLog	(revision 20140)
@@ -1,3 +1,9 @@
+Sat Nov  8 01:42:13 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread_pthread.c (native_cond_timedwait): returns error code.
+
+	* thread_pthread.c (thread_timer): typo fixed.
+
 Sat Nov  8 01:14:16 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* thread_pthread.c (thread_timer, rb_thread_create_timer_thread):
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 20139)
+++ thread_pthread.c	(revision 20140)
@@ -116,10 +116,10 @@
     pthread_cond_wait(cond, mutex);
 }
 
-static void
+static int
 native_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *ts)
 {
-    pthread_cond_timedwait(cond, mutex, ts);
+    return pthread_cond_timedwait(cond, mutex, ts);
 }
 
 
@@ -680,8 +680,8 @@
 
     native_mutex_lock(&timer_thread_lock);
     native_cond_signal(&timer_thread_cond);
-#define WAIT_FOR_10MS() native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, get_ts(&ts, PER_NANO/100)
-    while ((err = WAIT_FOR_10MS()) != 0) {
+#define WAIT_FOR_10MS() native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, get_ts(&ts, PER_NANO/100))
+    while ((err = WAIT_FOR_10MS()) != 0 && err != EINTR) {
 	if (err != ETIMEDOUT) {
 	    rb_bug("thread_timer/timedwait: %d", err);
 	}

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

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