From 6b620a0f0813d28c3c544b4ff8cb595b38a6e908 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sun, 23 Oct 2011 17:05:55 +0300 Subject: liblzma: Fix a deadlock in the threaded encoder. It was triggered when reinitializing the encoder, e.g. when encoding two files. --- src/liblzma/common/stream_encoder_mt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/liblzma/common/stream_encoder_mt.c') diff --git a/src/liblzma/common/stream_encoder_mt.c b/src/liblzma/common/stream_encoder_mt.c index 323f04a2..a4b28006 100644 --- a/src/liblzma/common/stream_encoder_mt.c +++ b/src/liblzma/common/stream_encoder_mt.c @@ -295,8 +295,10 @@ worker_start(void *thr_ptr) while (true) { // The thread is already idle so if we are // requested to stop, just set the state. - if (thr->state == THR_STOP) + if (thr->state == THR_STOP) { thr->state = THR_IDLE; + pthread_cond_signal(&thr->cond); + } state = thr->state; if (state != THR_IDLE) -- cgit v1.2.3