mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 04:36:07 +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
|
#ifdef XRT_OS_LINUX
|
||||||
struct timespec spec;
|
struct timespec spec;
|
||||||
spec.tv_sec = 0;
|
spec.tv_sec = (nsec / (1000 * 1000 * 1000));
|
||||||
spec.tv_nsec = nsec, nanosleep(&spec, NULL);
|
spec.tv_nsec = (nsec % (1000 * 1000 * 1000));
|
||||||
|
nanosleep(&spec, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue