Mesa (master): llvmpipe: add pipe_thread_wait() calls
Brian Paul
brianp at kemper.freedesktop.org
Fri Mar 5 13:25:23 PST 2010
Module: Mesa
Branch: master
Commit: b704a4e8f332e7f9a38c21ce074cd244cf2fe89e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b704a4e8f332e7f9a38c21ce074cd244cf2fe89e
Author: Brian Paul <brianp at vmware.com>
Date: Fri Mar 5 14:24:02 2010 -0700
llvmpipe: add pipe_thread_wait() calls
Wait for threads to exit before cleaning up per-thread data.
Fixes hang on context destruction with glean makeCurrent test.
See fd.o bug 26536.
---
src/gallium/drivers/llvmpipe/lp_rast.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 0f83eea..dd9a8e8 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -846,6 +846,12 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
pipe_semaphore_signal(&rast->tasks[i].work_ready);
}
+ /* Wait for threads to terminate before cleaning up per-thread data */
+ for (i = 0; i < rast->num_threads; i++) {
+ pipe_thread_wait(rast->threads[i]);
+ }
+
+ /* Clean up per-thread data */
for (i = 0; i < rast->num_threads; i++) {
pipe_semaphore_destroy(&rast->tasks[i].work_ready);
pipe_semaphore_destroy(&rast->tasks[i].work_done);
More information about the mesa-commit
mailing list