Browse Source

gallium/os: Fix os_time_sleep() on Windows for small durations.

Prevents undetermined sleeps.

Reviewed-by: Brian Paul <brianp@vmware.com>
tags/gles3-fmt-v1
José Fonseca 13 years ago
parent
commit
7e14293556
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/gallium/auxiliary/os/os_time.c

+ 5
- 1
src/gallium/auxiliary/os/os_time.c View File

@@ -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…
Cancel
Save