[Mesa-dev] [PATCH 2/3] st/nine: plug thread related leaks

Andre Heider a.heider at gmail.com
Tue Nov 6 08:27:13 UTC 2018


Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 src/gallium/state_trackers/nine/nine_queue.c | 4 ++++
 src/gallium/state_trackers/nine/nine_state.c | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/src/gallium/state_trackers/nine/nine_queue.c b/src/gallium/state_trackers/nine/nine_queue.c
index 7a85798f0f..c09810b1a8 100644
--- a/src/gallium/state_trackers/nine/nine_queue.c
+++ b/src/gallium/state_trackers/nine/nine_queue.c
@@ -265,8 +265,12 @@ void
 nine_queue_delete(struct nine_queue_pool *ctx)
 {
     unsigned i;
+
     mtx_destroy(&ctx->mutex_pop);
+    cnd_destroy(&ctx->event_pop);
+
     mtx_destroy(&ctx->mutex_push);
+    cnd_destroy(&ctx->event_push);
 
     for (i = 0; i < NINE_CMD_BUFS; i++)
         FREE(ctx->pool[i].mem_pool);
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index 74aaf57a54..273be88e2b 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -234,7 +234,12 @@ nine_csmt_destroy( struct NineDevice9 *device, struct csmt_context *ctx )
 
     nine_csmt_wait_processed(ctx);
     nine_queue_delete(ctx->pool);
+
+    mtx_destroy(&ctx->thread_resume);
+    mtx_destroy(&ctx->thread_running);
+
     mtx_destroy(&ctx->mutex_processed);
+    cnd_destroy(&ctx->event_processed);
 
     FREE(ctx);
 
-- 
2.19.1



More information about the mesa-dev mailing list