diff options
author | Christian König <[email protected]> | 2013-09-21 13:21:47 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2013-09-22 10:33:20 +0200 |
commit | f7ccb84aa1cd64703308dece03da0d4eb3bf4951 (patch) | |
tree | 971ebceb1691a956f1152724c9ba28c5ecf5363e /src/gallium/winsys | |
parent | 938956ad52bc7659212b5877080967d4af0aad81 (diff) |
winsys/radeon: fix killing the CS thread
Kill the thread only after we checked that it's not used any more, not before.
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index 69c42a07ea7..0a3b932a3af 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -421,6 +421,10 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws) { struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws; + if (!pipe_reference(&ws->base.reference, NULL)) { + return; + } + if (ws->thread) { ws->kill_thread = 1; pipe_semaphore_signal(&ws->cs_queued); @@ -429,10 +433,6 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws) pipe_semaphore_destroy(&ws->cs_queued); pipe_condvar_destroy(ws->cs_queue_empty); - if (!pipe_reference(&ws->base.reference, NULL)) { - return; - } - pipe_mutex_destroy(ws->hyperz_owner_mutex); pipe_mutex_destroy(ws->cmask_owner_mutex); pipe_mutex_destroy(ws->cs_stack_lock); |