diff options
author | Marek Olšák <[email protected]> | 2017-02-20 18:42:41 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-02-22 20:26:39 +0100 |
commit | 24847dd1b5327d40069a7b72e8286187675f99b2 (patch) | |
tree | a6944286d37b153bc6ddd3d84d70d851b98813c3 /src/gallium/auxiliary/util | |
parent | 4aea8fe7e01f2b65ffad3982687f90c8fa941524 (diff) |
gallium/u_queue: isolate util_queue_fence implementation
it's cleaner this way.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.c | 42 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_queue.h | 2 |
2 files changed, 24 insertions, 20 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, diff --git a/src/gallium/auxiliary/util/u_queue.h b/src/gallium/auxiliary/util/u_queue.h index 335813f63c1..2e0a5a36e26 100644 --- a/src/gallium/auxiliary/util/u_queue.h +++ b/src/gallium/auxiliary/util/u_queue.h @@ -87,7 +87,7 @@ void util_queue_add_job(struct util_queue *queue, util_queue_execute_func execute, util_queue_execute_func cleanup); -void util_queue_job_wait(struct util_queue_fence *fence); +void util_queue_fence_wait(struct util_queue_fence *fence); int64_t util_queue_get_thread_time_nano(struct util_queue *queue, unsigned thread_index); |