summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2016-09-08 09:43:36 +0200
committerEven Rouault <even.rouault@spatialys.com>2016-09-08 09:43:36 +0200
commitab22c5bad55fccdc440847c896baaf4bf89365a0 (patch)
tree11e4ded23c11c7958e4a3ff13746dc36544a850d /src/lib
parent4f9abb9a45ffd711f9717db15d062fa020ed6cf5 (diff)
opj_thread_pool: fix potential deadlock at thread pool destruction
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/thread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/openjp2/thread.c b/src/lib/openjp2/thread.c
index 59b5d87e..fce563d0 100644
--- a/src/lib/openjp2/thread.c
+++ b/src/lib/openjp2/thread.c
@@ -930,7 +930,9 @@ void opj_thread_pool_destroy(opj_thread_pool_t* tp)
int i;
opj_thread_pool_wait_completion(tp, 0);
+ opj_mutex_lock(tp->mutex);
tp->state = OPJWTS_STOP;
+ opj_mutex_unlock(tp->mutex);
for(i=0;i<tp->worker_threads_count;i++)
{