*/
typedef cnd_t pipe_condvar;
-#define pipe_condvar_wait(cond, mutex) \
- cnd_wait(&(cond), &(mutex))
-
#define pipe_condvar_signal(cond) \
cnd_signal(&(cond))
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;
{
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);
{
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);
}
/* 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);
/* 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);
/* 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:
*/
*/
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)) {
pipe_mutex_lock(f->mutex);
assert(f->issued);
while (f->count < f->rank) {
- pipe_condvar_wait(f->signalled, f->mutex);
+ cnd_wait(&f->signalled, &f->mutex);
}
pipe_mutex_unlock(f->mutex);
}
/* wait for rbug to clear the blocked flag */
while (rb_pipe->draw_blocked & flag) {
rb_pipe->draw_blocked |= flag;
- pipe_condvar_wait(rb_pipe->draw_cond, rb_pipe->draw_mutex);
+ cnd_wait(&rb_pipe->draw_cond, &rb_pipe->draw_mutex);
}
}
while (!cmdbuf->full)
{
DBG("waiting for full cmdbuf\n");
- pipe_condvar_wait(ctx->event_push, ctx->mutex_push);
+ cnd_wait(&ctx->event_push, &ctx->mutex_push);
}
DBG("got cmdbuf=%p\n", cmdbuf);
pipe_mutex_unlock(ctx->mutex_push);
while (cmdbuf->full)
{
DBG("waiting for empty cmdbuf\n");
- pipe_condvar_wait(ctx->event_pop, ctx->mutex_pop);
+ cnd_wait(&ctx->event_pop, &ctx->mutex_pop);
}
DBG("got empty cmdbuf=%p\n", cmdbuf);
pipe_mutex_unlock(ctx->mutex_pop);
{
pipe_mutex_lock(ctx->mutex_processed);
while (!p_atomic_read(&ctx->processed)) {
- pipe_condvar_wait(ctx->event_processed, ctx->mutex_processed);
+ cnd_wait(&ctx->event_processed, &ctx->mutex_processed);
}
pipe_mutex_unlock(ctx->mutex_processed);
}