28 #ifdef __DEVELOPMENT_ASSERTIONS__
38 pthread_cond_init(&cond, &attr.attr);
43 pthread_cond_destroy(&cond);
46 bool Conditional::isLocked()
60 #ifdef __DEVELOPMENT_ASSERTIONS__
66 pthread_cond_broadcast( &cond );
68 pthread_cond_signal( &cond );
73 #ifdef __DEVELOPMENT_ASSERTIONS__
82 pthread_cond_wait( &cond, &m_mutex );
88 gettimeout(timeout, &ts);
96 #ifdef __DEVELOPMENT_ASSERTIONS__
103 int ret = pthread_cond_timedwait(&cond, &m_mutex, ts);
117 Conditional::attribute Conditional::attr;
119 Conditional::attribute::attribute()
121 pthread_condattr_init(&attr);
123 #if _POSIX_TIMERS > 0 && defined(HAVE_PTHREAD_CONDATTR_SETCLOCK)
124 #if defined(_POSIX_MONOTONIC_CLOCK)
125 pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
127 pthread_condattr_setclock(&attr, CLOCK_REALTIME);
134 #if _POSIX_TIMERS > 0 && defined(HAVE_PTHREAD_CONDATTR_SETCLOCK)
135 #if defined(_POSIX_MONOTONIC_CLOCK)
136 clock_gettime(CLOCK_MONOTONIC, ts);
138 clock_gettime(CLOCK_REALTIME, ts);
142 ::gettimeofday(&tv, NULL);
143 ts->tv_sec = tv.tv_sec;
144 ts->tv_nsec = tv.tv_usec * 1000l;
146 ts->tv_sec += msec / 1000;
147 ts->tv_nsec += (msec % 1000) * 1000000l;
148 while(ts->tv_nsec > 1000000000l) {
150 ts->tv_nsec -= 1000000000l;
156 #ifdef __DEVELOPMENT_ASSERTIONS__
159 #endif // __DEVELOPMENT_ASSERTIONS__