mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-24 11:08:45 +00:00
21 lines
375 B
C
21 lines
375 B
C
|
|
||
|
#include <isc/condition.h>
|
||
|
#include <errno.h>
|
||
|
|
||
|
boolean_t
|
||
|
os_condition_waituntil(os_condition_t *c, os_mutex_t *m, struct timespec *ts,
|
||
|
boolean_t *timeout)
|
||
|
{
|
||
|
int result;
|
||
|
|
||
|
result = pthread_cond_timedwait(c, m, ts);
|
||
|
if (result == 0) {
|
||
|
*timeout = FALSE;
|
||
|
return (TRUE);
|
||
|
} else if (result == ETIMEDOUT) {
|
||
|
*timeout = TRUE;
|
||
|
return (TRUE);
|
||
|
}
|
||
|
return (FALSE);
|
||
|
}
|