gallium/os: Fix os_time_sleep() on Windows for small durations.
Prevents undetermined sleeps. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
d8069b7603
commit
7e14293556
|
@ -88,7 +88,11 @@ os_time_get_nano(void)
|
|||
void
|
||||
os_time_sleep(int64_t usecs)
|
||||
{
|
||||
Sleep((usecs + 999) / 1000);
|
||||
DWORD dwMilliseconds = (usecs + 999) / 1000;
|
||||
/* Avoid Sleep(O) as that would cause to sleep for an undetermined duration */
|
||||
if (dwMilliseconds) {
|
||||
Sleep(dwMilliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue