mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
Fix for pthread_condtimedwait failing occasionally
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@954 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
95df158b78
commit
3ee4713670
@ -309,7 +309,7 @@ OZ_DECLARE(zap_status_t) zap_condition_wait(zap_condition_t *condition, int ms)
|
|||||||
|
|
||||||
waitms.tv_nsec = 1000*(t.tv_usec + (1000 * ( ms % 1000 )));
|
waitms.tv_nsec = 1000*(t.tv_usec + (1000 * ( ms % 1000 )));
|
||||||
|
|
||||||
if (waitms.tv_nsec > ONE_BILLION) {
|
if (waitms.tv_nsec >= ONE_BILLION) {
|
||||||
waitms.tv_sec++;
|
waitms.tv_sec++;
|
||||||
waitms.tv_nsec-= ONE_BILLION;
|
waitms.tv_nsec-= ONE_BILLION;
|
||||||
}
|
}
|
||||||
@ -322,6 +322,7 @@ OZ_DECLARE(zap_status_t) zap_condition_wait(zap_condition_t *condition, int ms)
|
|||||||
if (res == ETIMEDOUT) {
|
if (res == ETIMEDOUT) {
|
||||||
return ZAP_TIMEOUT;
|
return ZAP_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
zap_log(ZAP_LOG_CRIT,"pthread_cond_timedwait failed (%d)\n", res);
|
zap_log(ZAP_LOG_CRIT,"pthread_cond_timedwait failed (%d)\n", res);
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user