gallium/util: replace pipe_condvar_signal() with cnd_signal()
authorTimothy Arceri <tarceri@itsqueeze.com>
Sat, 4 Mar 2017 23:41:32 +0000 (10:41 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 6 Mar 2017 21:23:26 +0000 (08:23 +1100)
pipe_condvar_signal() 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/state_trackers/nine/nine_queue.c
src/gallium/state_trackers/nine/nine_state.c

index 6895f4e97f4c4be53462be5f255ca6663f83d7a2..a8b5d926342cda314f2158e9b3644c1b821f3aa0 100644 (file)
@@ -148,9 +148,6 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_signal(cond) \
-   cnd_signal(&(cond))
-
 #define pipe_condvar_broadcast(cond) \
    cnd_broadcast(&(cond))
 
@@ -264,7 +261,7 @@ pipe_semaphore_signal(pipe_semaphore *sema)
 {
    pipe_mutex_lock(sema->mutex);
    sema->counter++;
-   pipe_condvar_signal(sema->cond);
+   cnd_signal(&sema->cond);
    pipe_mutex_unlock(sema->mutex);
 }
 
index 8fc2f3b3bb230d3044a2967e65c1e2c21f009ff8..3cef7d200bac58a759677d1bbc6fb443425f2229 100644 (file)
@@ -168,7 +168,7 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input)
       queue->read_idx = (queue->read_idx + 1) % queue->max_jobs;
 
       queue->num_queued--;
-      pipe_condvar_signal(queue->has_space_cond);
+      cnd_signal(&queue->has_space_cond);
       pipe_mutex_unlock(queue->lock);
 
       if (job.job) {
@@ -316,7 +316,7 @@ util_queue_add_job(struct util_queue *queue,
    queue->write_idx = (queue->write_idx + 1) % queue->max_jobs;
 
    queue->num_queued++;
-   pipe_condvar_signal(queue->has_queued_cond);
+   cnd_signal(&queue->has_queued_cond);
    pipe_mutex_unlock(queue->lock);
 }
 
index adba9ead773021a18a8c89f9843d84b120979502..a97236fe54cc6181e0fadd4208a7a141113bf404 100644 (file)
@@ -102,7 +102,7 @@ void util_ringbuffer_enqueue( struct util_ringbuffer *ring,
 
    /* Signal change:
     */
-   pipe_condvar_signal(ring->change);
+   cnd_signal(&ring->change);
    pipe_mutex_unlock(ring->mutex);
 }
 
@@ -154,7 +154,7 @@ enum pipe_error util_ringbuffer_dequeue( struct util_ringbuffer *ring,
 out:
    /* Signal change:
     */
-   pipe_condvar_signal(ring->change);
+   cnd_signal(&ring->change);
    pipe_mutex_unlock(ring->mutex);
    return ret;
 }
index fdfbdbb2472940407734dcdbb60a59ae4d4e8293..b50b57bc90f4f0cd26283b0f283781ba003c1c4a 100644 (file)
@@ -114,7 +114,7 @@ nine_queue_get(struct nine_queue_pool* ctx)
         pipe_mutex_lock(ctx->mutex_pop);
         DBG("freeing cmdbuf=%p\n", cmdbuf);
         cmdbuf->full = 0;
-        pipe_condvar_signal(ctx->event_pop);
+        cnd_signal(&ctx->event_pop);
         pipe_mutex_unlock(ctx->mutex_pop);
 
         ctx->tail = (ctx->tail + 1) & NINE_CMD_BUFS_MASK;
@@ -150,7 +150,7 @@ nine_queue_flush(struct nine_queue_pool* ctx)
     /* signal waiting worker */
     pipe_mutex_lock(ctx->mutex_push);
     cmdbuf->full = 1;
-    pipe_condvar_signal(ctx->event_push);
+    cnd_signal(&ctx->event_push);
     pipe_mutex_unlock(ctx->mutex_push);
 
     ctx->head = (ctx->head + 1) & NINE_CMD_BUFS_MASK;
index 0a2a0b9c792d2a08a588d47ff46befb2da07a1dc..90c49cf8f88a973743283a12604f84dd8a00a4fc 100644 (file)
@@ -108,7 +108,7 @@ PIPE_THREAD_ROUTINE(nine_csmt_worker, arg)
             if (instr->func(ctx->device, instr)) {
                 pipe_mutex_lock(ctx->mutex_processed);
                 p_atomic_set(&ctx->processed, TRUE);
-                pipe_condvar_signal(ctx->event_processed);
+                cnd_signal(&ctx->event_processed);
                 pipe_mutex_unlock(ctx->mutex_processed);
             }
             if (p_atomic_read(&ctx->toPause)) {
@@ -124,7 +124,7 @@ PIPE_THREAD_ROUTINE(nine_csmt_worker, arg)
         if (p_atomic_read(&ctx->terminate)) {
             pipe_mutex_lock(ctx->mutex_processed);
             p_atomic_set(&ctx->processed, TRUE);
-            pipe_condvar_signal(ctx->event_processed);
+            cnd_signal(&ctx->event_processed);
             pipe_mutex_unlock(ctx->mutex_processed);
             break;
         }