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

ruby-changes:23623

From: yugui <ko1@a...>
Date: Thu, 17 May 2012 12:55:02 +0900 (JST)
Subject: [ruby-changes:23623] yugui:r35674 (trunk): * thread.c, thread_pthread.c: Moved pthread-specific preprocessor

yugui	2012-05-17 12:54:50 +0900 (Thu, 17 May 2012)

  New Revision: 35674

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

  Log:
    * thread.c, thread_pthread.c: Moved pthread-specific preprocessor
    hacks to thread_pthread.c

  Modified files:
    trunk/ChangeLog
    trunk/thread.c
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35673)
+++ ChangeLog	(revision 35674)
@@ -1,3 +1,8 @@
+Thu May 17 12:53:07 2012  Yuki Yugui Sonoda  <yugui@g...>
+
+	* thread.c, thread_pthread.c: Moved pthread-specific preprocessor
+	  hacks to thread_pthread.c
+
 Thu May 17 12:18:47 2012  Yuki Yugui Sonoda  <yugui@g...>
 
 	* io.c: Fix a mistake on merging the patch in the previous commit.
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 35673)
+++ thread_pthread.c	(revision 35674)
@@ -245,6 +245,7 @@
 static void
 native_cond_initialize(rb_thread_cond_t *cond, int flags)
 {
+#ifdef HAVE_PTHREAD_COND_INITIALIZE
     int r;
     pthread_condattr_t attr;
 
@@ -266,15 +267,18 @@
     }
 
     return;
- }
+#endif
+}
 
 static void
 native_cond_destroy(rb_thread_cond_t *cond)
 {
+#ifdef HAVE_PTHREAD_COND_INITIALIZE
     int r = pthread_cond_destroy(&cond->cond);
     if (r != 0) {
 	rb_bug_errno("pthread_cond_destroy", r);
     }
+#endif
 }
 #endif
 
Index: thread.c
===================================================================
--- thread.c	(revision 35673)
+++ thread.c	(revision 35674)
@@ -3303,9 +3303,7 @@
 	    if (err) rb_bug("%s", err);
 	}
 	native_mutex_destroy(&mutex->lock);
-#ifdef HAVE_PTHREAD_COND_INITIALIZE
 	native_cond_destroy(&mutex->cond);
-#endif
     }
     ruby_xfree(ptr);
 }
@@ -3340,9 +3338,7 @@
 
     obj = TypedData_Make_Struct(klass, rb_mutex_t, &mutex_data_type, mutex);
     native_mutex_initialize(&mutex->lock);
-#ifdef HAVE_PTHREAD_COND_INITIALIZE
     native_cond_initialize(&mutex->cond, RB_CONDATTR_CLOCK_MONOTONIC);
-#endif
     return obj;
 }
 

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

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