OSDN Git Service
(root)
/
android-x86
/
external-mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d8069b7
)
gallium/os: Fix os_time_sleep() on Windows for small durations.
author
José Fonseca
<jfonseca@vmware.com>
Tue, 4 Dec 2012 19:44:08 +0000
(19:44 +0000)
committer
José Fonseca
<jfonseca@vmware.com>
Thu, 6 Dec 2012 17:12:31 +0000
(17:12 +0000)
Prevents undetermined sleeps.
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/os/os_time.c
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/os/os_time.c
b/src/gallium/auxiliary/os/os_time.c
index
4055125
..
f943e0f
100644
(file)
--- a/
src/gallium/auxiliary/os/os_time.c
+++ b/
src/gallium/auxiliary/os/os_time.c
@@
-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