summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/trace/tr_context.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2009-06-05 03:01:34 +0100
committerJakob Bornecrantz <jakob@vmware.com>2009-06-05 03:01:34 +0100
commit61ffba44fd70abefd22366aa296b7afb04c6767a (patch)
tree52f5f78872c5fe8f9e99e7237768ae01976d7ae4 /src/gallium/drivers/trace/tr_context.c
parentd4c578ae415623bdbc12885f93405b43141cc09a (diff)
trace/rbug: Use condvar on system that has it for blocking
Diffstat (limited to 'src/gallium/drivers/trace/tr_context.c')
-rw-r--r--src/gallium/drivers/trace/tr_context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index b04cc2ce56..dd5cca58dd 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -127,9 +127,13 @@ trace_context_draw_block(struct trace_context *tr_ctx, int flag)
/* 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);
@@ -1191,6 +1195,7 @@ trace_context_create(struct pipe_screen *_screen,
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);