mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
Added changes for mutex profiling.
This commit is contained in:
parent
b2a6ebf1bd
commit
2e36a55861
@ -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 <config.h>
|
||||
|
||||
@ -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)
|
||||
|
@ -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) ? \
|
||||
|
Loading…
x
Reference in New Issue
Block a user