util/time: add util_time_sleep() for windows userspace
authorKeith Whitwell <keithw@vmware.com>
Mon, 27 Apr 2009 13:43:31 +0000 (14:43 +0100)
committerKeith Whitwell <keithw@vmware.com>
Mon, 27 Apr 2009 13:43:57 +0000 (14:43 +0100)
Somebody with a clue could probably do a better implemenation...

src/gallium/auxiliary/util/u_time.c

index 8afe4fccf7bbcd38f697ec7666e923f67b2951ba..8e167d3c42f0f2429031495d0919cffcd2d5d83c 100644 (file)
@@ -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