gallium/util: replace pipe_condvar_destroy() with cnd_destroy()
authorTimothy Arceri <tarceri@itsqueeze.com>
Sat, 4 Mar 2017 23:41:30 +0000 (10:41 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 6 Mar 2017 21:23:26 +0000 (08:23 +1100)
pipe_condvar_destroy() was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/os/os_thread.h
src/gallium/auxiliary/util/u_queue.c
src/gallium/auxiliary/util/u_ringbuffer.c
src/gallium/drivers/llvmpipe/lp_fence.c

index e1dc210a6e3013ce25047f2bb5fc226f7ef5782d..e230d06149e33923059eed4004f76366968caecf 100644 (file)
@@ -148,9 +148,6 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_destroy(cond) \
-   cnd_destroy(&(cond))
-
 #define pipe_condvar_wait(cond, mutex) \
    cnd_wait(&(cond), &(mutex))
 
@@ -208,7 +205,7 @@ static inline void pipe_barrier_destroy(pipe_barrier *barrier)
 {
    assert(barrier->waiters == 0);
    pipe_mutex_destroy(barrier->mutex);
-   pipe_condvar_destroy(barrier->condvar);
+   cnd_destroy(&barrier->condvar);
 }
 
 static inline void pipe_barrier_wait(pipe_barrier *barrier)
@@ -261,7 +258,7 @@ static inline void
 pipe_semaphore_destroy(pipe_semaphore *sema)
 {
    pipe_mutex_destroy(sema->mutex);
-   pipe_condvar_destroy(sema->cond);
+   cnd_destroy(&sema->cond);
 }
 
 /** Signal/increment semaphore counter */
index dff5b154cac488832ab439bb4b2803cc2d7e51b7..87f0120d8883004199949fd3087b06f27cae996a 100644 (file)
@@ -122,7 +122,7 @@ void
 util_queue_fence_destroy(struct util_queue_fence *fence)
 {
    assert(fence->signalled);
-   pipe_condvar_destroy(fence->cond);
+   cnd_destroy(&fence->cond);
    pipe_mutex_destroy(fence->mutex);
 }
 
@@ -249,8 +249,8 @@ fail:
    FREE(queue->threads);
 
    if (queue->jobs) {
-      pipe_condvar_destroy(queue->has_space_cond);
-      pipe_condvar_destroy(queue->has_queued_cond);
+      cnd_destroy(&queue->has_space_cond);
+      cnd_destroy(&queue->has_queued_cond);
       pipe_mutex_destroy(queue->lock);
       FREE(queue->jobs);
    }
@@ -281,8 +281,8 @@ util_queue_destroy(struct util_queue *queue)
    util_queue_killall_and_wait(queue);
    remove_from_atexit_list(queue);
 
-   pipe_condvar_destroy(queue->has_space_cond);
-   pipe_condvar_destroy(queue->has_queued_cond);
+   cnd_destroy(&queue->has_space_cond);
+   cnd_destroy(&queue->has_queued_cond);
    pipe_mutex_destroy(queue->lock);
    FREE(queue->jobs);
    FREE(queue->threads);
index e3be3ef1fba33196a6f7e59331b50111c9664d02..334be6a1d4706df701a1b9111e488b96573db881 100644 (file)
@@ -47,7 +47,7 @@ fail:
 
 void util_ringbuffer_destroy( struct util_ringbuffer *ring )
 {
-   pipe_condvar_destroy(ring->change);
+   cnd_destroy(&ring->change);
    pipe_mutex_destroy(ring->mutex);
    FREE(ring->buf);
    FREE(ring);
index 1529981bbe5ac7c90a85091459c2820b1566c895..3b35eb2e9f249e6cf343f2910da669b44bdf00e3 100644 (file)
@@ -73,7 +73,7 @@ lp_fence_destroy(struct lp_fence *fence)
       debug_printf("%s %d\n", __FUNCTION__, fence->id);
 
    pipe_mutex_destroy(fence->mutex);
-   pipe_condvar_destroy(fence->signalled);
+   cnd_destroy(&fence->signalled);
    FREE(fence);
 }