mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Added changes for mutex profiling.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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>
|
#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);
|
ts.tv_nsec = (long)isc_time_nanoseconds(t);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
#if ISC_MUTEX_PROFILE
|
||||||
|
presult = pthread_cond_timedwait(c, m->mutex, &ts);
|
||||||
|
#else
|
||||||
presult = pthread_cond_timedwait(c, m, &ts);
|
presult = pthread_cond_timedwait(c, m, &ts);
|
||||||
|
#endif
|
||||||
if (presult == 0)
|
if (presult == 0)
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
if (presult == ETIMEDOUT)
|
if (presult == ETIMEDOUT)
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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
|
#ifndef ISC_CONDITION_H
|
||||||
#define ISC_CONDITION_H 1
|
#define ISC_CONDITION_H 1
|
||||||
@@ -31,9 +31,15 @@ typedef pthread_cond_t isc_condition_t;
|
|||||||
((pthread_cond_init((cp), NULL) == 0) ? \
|
((pthread_cond_init((cp), NULL) == 0) ? \
|
||||||
ISC_R_SUCCESS : ISC_R_UNEXPECTED)
|
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) \
|
#define isc_condition_wait(cp, mp) \
|
||||||
((pthread_cond_wait((cp), (mp)) == 0) ? \
|
((pthread_cond_wait((cp), (mp)) == 0) ? \
|
||||||
ISC_R_SUCCESS : ISC_R_UNEXPECTED)
|
ISC_R_SUCCESS : ISC_R_UNEXPECTED)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define isc_condition_signal(cp) \
|
#define isc_condition_signal(cp) \
|
||||||
((pthread_cond_signal((cp)) == 0) ? \
|
((pthread_cond_signal((cp)) == 0) ? \
|
||||||
|
Reference in New Issue
Block a user