enum {
thrd_success = 0, // succeeded
- thrd_timeout, // timeout
+ thrd_timedout, // timed out
thrd_error, // failed
thrd_busy, // resource busy
thrd_nomem // out of memory
rt = pthread_cond_timedwait(cond, mtx, abs_time);
if (rt == ETIMEDOUT)
- return thrd_busy;
+ return thrd_timedout;
return (rt == 0) ? thrd_success : thrd_error;
}
rt = pthread_mutex_timedlock(mtx, ts);
if (rt == 0)
return thrd_success;
- return (rt == ETIMEDOUT) ? thrd_busy : thrd_error;
+ return (rt == ETIMEDOUT) ? thrd_timedout : thrd_error;
#else
time_t expire = time(NULL);
expire += ts->tv_sec;
while (mtx_trylock(mtx) != thrd_success) {
time_t now = time(NULL);
if (expire < now)
- return thrd_busy;
+ return thrd_timedout;
// busy loop!
thrd_yield();
}
const DWORD timeout = impl_abs2relmsec(abs_time);
if (SleepConditionVariableCS(cond, mtx, timeout))
return thrd_success;
- return (GetLastError() == ERROR_TIMEOUT) ? thrd_busy : thrd_error;
+ return (GetLastError() == ERROR_TIMEOUT) ? thrd_timedout : thrd_error;
#else
return thrd_error;
#endif
#ifdef HAVE_TIMESPEC_GET
while (mtx_trylock(mtx) != thrd_success) {
if (impl_abs2relmsec(ts) == 0)
- return thrd_busy;
+ return thrd_timedout;
// busy loop!
thrd_yield();
}
ret = cnd_timedwait(&dri2_sync->cond, &dri2_sync->mutex, &expire);
mtx_unlock(&dri2_sync->mutex);
- if (ret == thrd_busy) {
+ if (ret == thrd_timedout) {
if (dri2_sync->base.SyncStatus == EGL_UNSIGNALED_KHR) {
ret = EGL_TIMEOUT_EXPIRED_KHR;
} else {
const DWORD timeout = (future > now) ? (DWORD)(future - now) : 0;
if (SleepConditionVariableCS(&cond->condvar, mtx, timeout))
return thrd_success;
- return (GetLastError() == ERROR_TIMEOUT) ? thrd_busy : thrd_error;
+ return (GetLastError() == ERROR_TIMEOUT) ? thrd_timedout : thrd_error;
#else
int rt = pthread_cond_timedwait(&cond->cond, mtx, abs_time);
if (rt == ETIMEDOUT)
- return thrd_busy;
+ return thrd_timedout;
return (rt == 0) ? thrd_success : thrd_error;
#endif
}