/* wait for rbug to clear the blocked flag */
while (tr_ctx->draw_blocked & flag) {
tr_ctx->draw_blocked |= flag;
+#ifdef PIPE_THREAD_HAVE_CONDVAR
+ pipe_condvar_wait(tr_ctx->draw_cond, tr_ctx->draw_mutex);
+#else
pipe_mutex_unlock(tr_ctx->draw_mutex);
/* TODO sleep or use conditional */
pipe_mutex_lock(tr_ctx->draw_mutex);
+#endif
}
pipe_mutex_unlock(tr_ctx->draw_mutex);
rbug_blocker_flags,
0);
pipe_mutex_init(tr_ctx->draw_mutex);
+ pipe_condvar_init(tr_ctx->draw_cond);
pipe_mutex_init(tr_ctx->list_mutex);
make_empty_list(&tr_ctx->shaders);
tr_ctx->draw_blocked &= ~step->step;
pipe_mutex_unlock(tr_ctx->draw_mutex);
+#ifdef PIPE_THREAD_HAVE_CONDVAR
+ pipe_condvar_broadcast(tr_ctx->draw_cond);
+#endif
+
pipe_mutex_unlock(tr_scr->list_mutex);
return 0;
tr_ctx->draw_blocker &= ~unblock->unblock;
pipe_mutex_unlock(tr_ctx->draw_mutex);
+#ifdef PIPE_THREAD_HAVE_CONDVAR
+ pipe_condvar_broadcast(tr_ctx->draw_cond);
+#endif
+
pipe_mutex_unlock(tr_scr->list_mutex);
return 0;