ruby-changes:24948
From: kosaki <ko1@a...>
Date: Thu, 20 Sep 2012 23:16:04 +0900 (JST)
Subject: [ruby-changes:24948] kosaki:r37000 (trunk): * thread_pthread.c (native_cond_initialize): clean up #ifdef condition.
kosaki 2012-09-20 23:15:46 +0900 (Thu, 20 Sep 2012) New Revision: 37000 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37000 Log: * thread_pthread.c (native_cond_initialize): clean up #ifdef condition. Modified files: trunk/ChangeLog trunk/thread_pthread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 36999) +++ ChangeLog (revision 37000) @@ -1,3 +1,7 @@ +Thu Sep 20 22:53:02 2012 KOSAKI Motohiro <kosaki.motohiro@g...> + + * thread_pthread.c (native_cond_initialize): clean up #ifdef condition. + Thu Sep 20 16:42:44 2012 NARUSE, Yui <naruse@r...> * lib/drb/ssl.rb (DRb::DRbSSLSocket::SSLConfig::DEFAULT): add Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 36999) +++ thread_pthread.c (revision 37000) @@ -46,7 +46,8 @@ #define RB_CONDATTR_CLOCK_MONOTONIC 1 #if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && defined(HAVE_CLOCKID_T) && \ - defined(CLOCK_REALTIME) && defined(CLOCK_MONOTONIC) && defined(HAVE_CLOCK_GETTIME) + defined(CLOCK_REALTIME) && defined(CLOCK_MONOTONIC) && \ + defined(HAVE_CLOCK_GETTIME) && defined(HAVE_PTHREAD_CONDATTR_INIT) #define USE_MONOTONIC_COND 1 #else #define USE_MONOTONIC_COND 0 @@ -248,12 +249,11 @@ { #ifdef HAVE_PTHREAD_COND_INIT int r; -# ifdef HAVE_PTHREAD_CONDATTR_INIT +# if USE_MONOTONIC_COND pthread_condattr_t attr; pthread_condattr_init(&attr); -# if USE_MONOTONIC_COND cond->clockid = CLOCK_REALTIME; if (flags & RB_CONDATTR_CLOCK_MONOTONIC) { r = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); @@ -261,7 +261,6 @@ cond->clockid = CLOCK_MONOTONIC; } } -# endif r = pthread_cond_init(&cond->cond, &attr); # else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/