diff --git a/lib/isc/pthreads/condition.c b/lib/isc/pthreads/condition.c index a494a812d5..6dbc8cf96b 100644 --- a/lib/isc/pthreads/condition.c +++ b/lib/isc/pthreads/condition.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: condition.c,v 1.26 2001/01/04 00:28:19 bwelling Exp $ */ +/* $Id: condition.c,v 1.27 2001/01/04 23:38:36 neild Exp $ */ #include @@ -49,7 +49,11 @@ isc_condition_waituntil(isc_condition_t *c, isc_mutex_t *m, isc_time_t *t) { ts.tv_nsec = (long)isc_time_nanoseconds(t); do { +#if ISC_MUTEX_PROFILE + presult = pthread_cond_timedwait(c, m->mutex, &ts); +#else presult = pthread_cond_timedwait(c, m, &ts); +#endif if (presult == 0) return (ISC_R_SUCCESS); if (presult == ETIMEDOUT) diff --git a/lib/isc/pthreads/include/isc/condition.h b/lib/isc/pthreads/include/isc/condition.h index 4c5a6c49ba..18c5e0a85a 100644 --- a/lib/isc/pthreads/include/isc/condition.h +++ b/lib/isc/pthreads/include/isc/condition.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: condition.h,v 1.18 2000/08/01 01:31:05 tale Exp $ */ +/* $Id: condition.h,v 1.19 2001/01/04 23:38:37 neild Exp $ */ #ifndef ISC_CONDITION_H #define ISC_CONDITION_H 1 @@ -31,9 +31,15 @@ typedef pthread_cond_t isc_condition_t; ((pthread_cond_init((cp), NULL) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) +#if ISC_MUTEX_PROFILE +#define isc_condition_wait(cp, mp) \ + ((pthread_cond_wait((cp), (mp->mutex)) == 0) ? \ + ISC_R_SUCCESS : ISC_R_UNEXPECTED) +#else #define isc_condition_wait(cp, mp) \ ((pthread_cond_wait((cp), (mp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) +#endif #define isc_condition_signal(cp) \ ((pthread_cond_signal((cp)) == 0) ? \