mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_pthread.c (native_cond_initialize): clean up #ifdef condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
025a2479ae
commit
187d2bc1d6
2 changed files with 7 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Sep 20 22:53:02 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* thread_pthread.c (native_cond_initialize): clean up #ifdef condition.
|
||||
|
||||
Thu Sep 20 16:42:44 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* lib/drb/ssl.rb (DRb::DRbSSLSocket::SSLConfig::DEFAULT): add
|
||||
|
|
|
@ -46,7 +46,8 @@ static pthread_t timer_thread_id;
|
|||
#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 @@ native_cond_initialize(rb_thread_cond_t *cond, int flags)
|
|||
{
|
||||
#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 @@ native_cond_initialize(rb_thread_cond_t *cond, int flags)
|
|||
cond->clockid = CLOCK_MONOTONIC;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
r = pthread_cond_init(&cond->cond, &attr);
|
||||
# else
|
||||
|
|
Loading…
Add table
Reference in a new issue