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

ruby-changes:18245

From: yugui <ko1@a...>
Date: Mon, 20 Dec 2010 22:30:57 +0900 (JST)
Subject: [ruby-changes:18245] Ruby:r30269 (ruby_1_9_2): merges r29962 from trunk into ruby_1_9_2.

yugui	2010-12-20 22:23:17 +0900 (Mon, 20 Dec 2010)

  New Revision: 30269

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

  Log:
    merges r29962 from trunk into ruby_1_9_2.
    --
    * thread_pthread.c (native_cond_*): Check return code.
      (Some OSs except Linux return error code).

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/thread_pthread.c
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 30268)
+++ ruby_1_9_2/ChangeLog	(revision 30269)
@@ -1,3 +1,8 @@
+Mon Nov 29 05:54:22 2010  Koichi Sasada  <ko1@a...>
+
+	* thread_pthread.c (native_cond_*): Check return code.
+	  (Some OSs except Linux return error code).
+
 Sat Nov 27 19:12:10 2010  Tanaka Akira  <akr@f...>
 
 	* time.c: parenthesize macro arguments.
Index: ruby_1_9_2/thread_pthread.c
===================================================================
--- ruby_1_9_2/thread_pthread.c	(revision 30268)
+++ ruby_1_9_2/thread_pthread.c	(revision 30269)
@@ -106,25 +106,38 @@
 static void
 native_cond_signal(pthread_cond_t *cond)
 {
-    pthread_cond_signal(cond);
+    int r = pthread_cond_signal(cond);
+    if (r != 0) {
+	rb_bug_errno("pthread_cond_signal", r);
+    }
 }
 
 static void
 native_cond_broadcast(pthread_cond_t *cond)
 {
-    pthread_cond_broadcast(cond);
+    int r = pthread_cond_broadcast(cond);
+    if (r != 0) {
+	rb_bug_errno("native_cond_broadcast", r);
+    }
 }
 
 static void
 native_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 {
-    pthread_cond_wait(cond, mutex);
+    int r = pthread_cond_wait(cond, mutex);
+    if (r != 0) {
+	rb_bug_errno("pthread_cond_wait", r);
+    }
 }
 
 static int
 native_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *ts)
 {
-    return pthread_cond_timedwait(cond, mutex, ts);
+    int r = pthread_cond_timedwait(cond, mutex, ts);
+    if (r != 0 && r != ETIMEDOUT && r != EINTR /* Linux */) {
+	rb_bug_errno("pthread_cond_timedwait", r);
+    }
+    return r;
 }
 
 
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 30268)
+++ ruby_1_9_2/version.h	(revision 30269)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 109
+#define RUBY_PATCHLEVEL 110
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1

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

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