[PS3] fix scond_wait_timeout

This commit is contained in:
ToadKing 2013-11-07 21:58:59 -05:00
parent 9d4d6fe23d
commit 4369b3dbce

View File

@ -329,20 +329,17 @@ bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
sys_time_sec_t s;
sys_time_nsec_t n;
sys_time_get_current_time(&s, &n);
now.tv_sec = s;
now.tv_nsec = n;
#elif !defined(GEKKO) // timeout on libogc is duration, not end time
clock_gettime(CLOCK_REALTIME, &now);
#endif
#if defined(__CELLOS_LV2__)
now.tv_sec = s;
now.tv_nsec = n;
#else
now.tv_sec += timeout_us / 1000000LL;
now.tv_nsec += timeout_us * 1000LL;
now.tv_sec += now.tv_nsec / 1000000000LL;
now.tv_nsec = now.tv_nsec % 1000000000LL;
#endif
int ret = pthread_cond_timedwait(&cond->cond, &lock->lock, &now);
return ret == 0;