Skip to content

Commit

Permalink
clang-format condition_variable.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
lunixbochs committed Mar 5, 2018
1 parent a8346d8 commit b5ec48f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/condition_variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ class condition_variable_t
{
pthread_condattr_t attr;
pthread_condattr_init (&attr);
#if !defined(ZMQ_HAVE_OSX) || (defined(ZMQ_HAVE_ANDROID) && !defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
#if !defined(ZMQ_HAVE_OSX) \
|| (defined(ZMQ_HAVE_ANDROID) \
&& !defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
#endif
int rc = pthread_cond_init (&cond, &attr);
Expand Down Expand Up @@ -218,9 +220,12 @@ class condition_variable_t
timeout.tv_nsec -= 1000000000;
}
#ifdef ZMQ_HAVE_OSX
rc = pthread_cond_timedwait_relative_np (&cond, mutex_->get_mutex (), &timeout);
#elif defined(ZMQ_HAVE_ANDROID) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
rc = pthread_cond_timedwait_monotonic_np (&cond, mutex_->get_mutex (), &timeout);
rc = pthread_cond_timedwait_relative_np (
&cond, mutex_->get_mutex (), &timeout);
#elif defined(ZMQ_HAVE_ANDROID) \
&& defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
rc = pthread_cond_timedwait_monotonic_np (
&cond, mutex_->get_mutex (), &timeout);
#else
rc = pthread_cond_timedwait (&cond, mutex_->get_mutex (), &timeout);
#endif
Expand Down

0 comments on commit b5ec48f

Please sign in to comment.