mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
aux: Support waiting more than 0.999... seconds in os_nanosleep
This commit is contained in:
parent
6133d4cf99
commit
a884e24b9a
|
@ -64,8 +64,9 @@ os_nanosleep(long nsec)
|
|||
{
|
||||
#ifdef XRT_OS_LINUX
|
||||
struct timespec spec;
|
||||
spec.tv_sec = 0;
|
||||
spec.tv_nsec = nsec, nanosleep(&spec, NULL);
|
||||
spec.tv_sec = (nsec / (1000 * 1000 * 1000));
|
||||
spec.tv_nsec = (nsec % (1000 * 1000 * 1000));
|
||||
nanosleep(&spec, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue