mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 15:32:59 +00:00
[PS3] fix scond_wait_timeout
This commit is contained in:
parent
9d4d6fe23d
commit
4369b3dbce
7
thread.c
7
thread.c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user