Mesa (master): util/time: add util_time_sleep() for windows userspace

Keith Whitwell keithw at kemper.freedesktop.org
Mon Apr 27 13:44:36 UTC 2009


Module: Mesa
Branch: master
Commit: 5250eec652af46d20261624fd043992355a0b4ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5250eec652af46d20261624fd043992355a0b4ba

Author: Keith Whitwell <keithw at vmware.com>
Date:   Mon Apr 27 14:43:31 2009 +0100

util/time: add util_time_sleep() for windows userspace

Somebody with a clue could probably do a better implemenation...

---

 src/gallium/auxiliary/util/u_time.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_time.c b/src/gallium/auxiliary/util/u_time.c
index 8afe4fc..8e167d3 100644
--- a/src/gallium/auxiliary/util/u_time.c
+++ b/src/gallium/auxiliary/util/u_time.c
@@ -217,4 +217,13 @@ void util_time_sleep(unsigned usecs)
    } while(start <= curr && curr < end || 
 	   end < start && (curr < end || start <= curr));
 }
+#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
+#include <unistd.h>
+#include <fcntl.h>
+ 
+
+void util_time_sleep(unsigned usecs)
+{
+   Sleep((usecs + 999)/ 1000);
+}
 #endif




More information about the mesa-commit mailing list