mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
Don't allow more than a billion nanoseconds
This commit is contained in:
parent
2c773a0eb8
commit
f3c57ee343
@ -819,6 +819,12 @@ bool scond_wait_timeout(scond_t *cond, slock_t *lock, int64_t timeout_us)
|
||||
|
||||
now.tv_sec += seconds;
|
||||
now.tv_nsec += remainder * INT64_C(1000);
|
||||
|
||||
if (now.tv_nsec > 1000000000)
|
||||
{
|
||||
now.tv_nsec -= 1000000000;
|
||||
now.tv_sec += 1;
|
||||
}
|
||||
|
||||
ret = pthread_cond_timedwait(&cond->cond, &lock->lock, &now);
|
||||
return (ret == 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user