aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/u_queue.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-10-22 17:38:30 +0200
committerNicolai Hähnle <[email protected]>2017-11-09 11:37:39 +0100
commit574c59d4f935cccfa18f7054c660200f8be791ad (patch)
treeb54d5075269299d19d8e194c0d3b921fbb689fea /src/util/u_queue.h
parent1b9d5ece557bc4ac1d69cc133dc533bb5a863dde (diff)
u_queue: add util_queue_fence_reset
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/util/u_queue.h')
-rw-r--r--src/util/u_queue.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/u_queue.h b/src/util/u_queue.h
index 5a546e53fdc..a3e12260e30 100644
--- a/src/util/u_queue.h
+++ b/src/util/u_queue.h
@@ -59,6 +59,19 @@ void util_queue_fence_destroy(struct util_queue_fence *fence);
void util_queue_fence_wait(struct util_queue_fence *fence);
void util_queue_fence_signal(struct util_queue_fence *fence);
+/**
+ * Move \p fence back into unsignalled state.
+ *
+ * \warning The caller must ensure that no other thread may currently be
+ * waiting (or about to wait) on the fence.
+ */
+static inline void
+util_queue_fence_reset(struct util_queue_fence *fence)
+{
+ assert(fence->signalled);
+ fence->signalled = 0;
+}
+
static inline bool
util_queue_fence_is_signalled(struct util_queue_fence *fence)
{