Fall back on clock_gettime when timespec_get() is unavailable
Fixes: e3a8013de8
"util/u_queue: add util_queue_fence_wait_timeout"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1020
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4088
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Yurii Kolesnykov <root@yurikoles.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8482>
This commit is contained in:
parent
81becaa685
commit
68a785e63f
|
@ -183,7 +183,11 @@ _util_queue_fence_wait_timeout(struct util_queue_fence *fence,
|
||||||
if (rel > 0) {
|
if (rel > 0) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
|
#ifdef HAVE_TIMESPEC_GET
|
||||||
timespec_get(&ts, TIME_UTC);
|
timespec_get(&ts, TIME_UTC);
|
||||||
|
#else
|
||||||
|
clock_gettime(CLOCK_REALTIME, &ts);
|
||||||
|
#endif
|
||||||
|
|
||||||
ts.tv_sec += abs_timeout / (1000*1000*1000);
|
ts.tv_sec += abs_timeout / (1000*1000*1000);
|
||||||
ts.tv_nsec += abs_timeout % (1000*1000*1000);
|
ts.tv_nsec += abs_timeout % (1000*1000*1000);
|
||||||
|
|
Loading…
Reference in New Issue