aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-03-05 10:41:31 +1100
committerTimothy Arceri <[email protected]>2017-03-07 08:23:26 +1100
commit74c879ac75d5e9262b668c8c6fdaa5d36e3c3bf3 (patch)
tree4600fd1eef8b5d964cfea8b10ba97286d6e0b292 /src/gallium/auxiliary
parent1e0314281a7d2e57b0e0ad2296445dffdb26dbd2 (diff)
gallium/util: replace pipe_condvar_wait() with cnd_wait()
pipe_condvar_wait() was made unnecessary with fd33a6bcd7f12. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/os/os_thread.h7
-rw-r--r--src/gallium/auxiliary/util/u_queue.c6
-rw-r--r--src/gallium/auxiliary/util/u_ringbuffer.c4
3 files changed, 7 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index e230d06149e..6895f4e97f4 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -148,9 +148,6 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
*/
typedef cnd_t pipe_condvar;
-#define pipe_condvar_wait(cond, mutex) \
- cnd_wait(&(cond), &(mutex))
-
#define pipe_condvar_signal(cond) \
cnd_signal(&(cond))
@@ -219,7 +216,7 @@ static inline void pipe_barrier_wait(pipe_barrier *barrier)
uint64_t sequence = barrier->sequence;
do {
- pipe_condvar_wait(barrier->condvar, barrier->mutex);
+ cnd_wait(&barrier->condvar, &barrier->mutex);
} while (sequence == barrier->sequence);
} else {
barrier->waiters = 0;
@@ -277,7 +274,7 @@ pipe_semaphore_wait(pipe_semaphore *sema)
{
pipe_mutex_lock(sema->mutex);
while (sema->counter <= 0) {
- pipe_condvar_wait(sema->cond, sema->mutex);
+ cnd_wait(&sema->cond, &sema->mutex);
}
sema->counter--;
pipe_mutex_unlock(sema->mutex);
diff --git a/src/gallium/auxiliary/util/u_queue.c b/src/gallium/auxiliary/util/u_queue.c
index 87f0120d888..8fc2f3b3bb2 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -105,7 +105,7 @@ util_queue_fence_wait(struct util_queue_fence *fence)
{
pipe_mutex_lock(fence->mutex);
while (!fence->signalled)
- pipe_condvar_wait(fence->cond, fence->mutex);
+ cnd_wait(&fence->cond, &fence->mutex);
pipe_mutex_unlock(fence->mutex);
}
@@ -156,7 +156,7 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input)
/* wait if the queue is empty */
while (!queue->kill_threads && queue->num_queued == 0)
- pipe_condvar_wait(queue->has_queued_cond, queue->lock);
+ cnd_wait(&queue->has_queued_cond, &queue->lock);
if (queue->kill_threads) {
pipe_mutex_unlock(queue->lock);
@@ -305,7 +305,7 @@ util_queue_add_job(struct util_queue *queue,
/* if the queue is full, wait until there is space */
while (queue->num_queued == queue->max_jobs)
- pipe_condvar_wait(queue->has_space_cond, queue->lock);
+ cnd_wait(&queue->has_space_cond, &queue->lock);
ptr = &queue->jobs[queue->write_idx];
assert(ptr->job == NULL);
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c
index 334be6a1d47..adba9ead773 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -85,7 +85,7 @@ void util_ringbuffer_enqueue( struct util_ringbuffer *ring,
/* Wait for free space:
*/
while (util_ringbuffer_space(ring) < packet->dwords)
- pipe_condvar_wait(ring->change, ring->mutex);
+ cnd_wait(&ring->change, &ring->mutex);
/* Copy data to ring:
*/
@@ -123,7 +123,7 @@ enum pipe_error util_ringbuffer_dequeue( struct util_ringbuffer *ring,
*/
if (wait) {
while (util_ringbuffer_empty(ring))
- pipe_condvar_wait(ring->change, ring->mutex);
+ cnd_wait(&ring->change, &ring->mutex);
}
else {
if (util_ringbuffer_empty(ring)) {