diff options
Diffstat (limited to 'src/gallium/auxiliary/util/u_queue.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c index 52cfc0a4bf2..386dc4a9946 100644 --- a/src/gallium/auxiliary/util/u_queue.c +++ b/src/gallium/auxiliary/util/u_queue.c @@ -88,7 +88,7 @@ remove_from_atexit_list(struct util_queue *queue) } /**************************************************************************** - * util_queue implementation + * util_queue_fence */ static void @@ -101,7 +101,7 @@ util_queue_fence_signal(struct util_queue_fence *fence) } void -util_queue_job_wait(struct util_queue_fence *fence) +util_queue_fence_wait(struct util_queue_fence *fence) { pipe_mutex_lock(fence->mutex); while (!fence->signalled) @@ -109,6 +109,27 @@ util_queue_job_wait(struct util_queue_fence *fence) pipe_mutex_unlock(fence->mutex); } +void +util_queue_fence_init(struct util_queue_fence *fence) +{ + memset(fence, 0, sizeof(*fence)); + pipe_mutex_init(fence->mutex); + pipe_condvar_init(fence->cond); + fence->signalled = true; +} + +void +util_queue_fence_destroy(struct util_queue_fence *fence) +{ + assert(fence->signalled); + pipe_condvar_destroy(fence->cond); + pipe_mutex_destroy(fence->mutex); +} + +/**************************************************************************** + * util_queue implementation + */ + struct thread_input { struct util_queue *queue; int thread_index; @@ -267,23 +288,6 @@ util_queue_destroy(struct util_queue *queue) } void -util_queue_fence_init(struct util_queue_fence *fence) -{ - memset(fence, 0, sizeof(*fence)); - pipe_mutex_init(fence->mutex); - pipe_condvar_init(fence->cond); - fence->signalled = true; -} - -void -util_queue_fence_destroy(struct util_queue_fence *fence) -{ - assert(fence->signalled); - pipe_condvar_destroy(fence->cond); - pipe_mutex_destroy(fence->mutex); -} - -void util_queue_add_job(struct util_queue *queue, void *job, struct util_queue_fence *fence, |