Mesa (master): util: Always use timespec_get on Windows.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 2 14:54:15 UTC 2021


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

Author: Jose Fonseca <jose.r.fonseca at gmail.com>
Date:   Wed Feb 24 20:02:34 2021 +0000

util: Always use timespec_get on Windows.

include/c11/threads_win32.h provides a fallback implementation of
timespec_get when necessary.

Fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/4109

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9280>

---

 src/util/u_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/u_queue.c b/src/util/u_queue.c
index f2aaba4627c..19aa829c522 100644
--- a/src/util/u_queue.c
+++ b/src/util/u_queue.c
@@ -183,7 +183,7 @@ _util_queue_fence_wait_timeout(struct util_queue_fence *fence,
    if (rel > 0) {
       struct timespec ts;
 
-#ifdef HAVE_TIMESPEC_GET
+#if defined(HAVE_TIMESPEC_GET) || defined(_WIN32)
       timespec_get(&ts, TIME_UTC);
 #else
       clock_gettime(CLOCK_REALTIME, &ts);



More information about the mesa-commit mailing list