diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2011-10-23 17:05:55 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2011-10-23 17:05:55 +0300 |
commit | 6b620a0f0813d28c3c544b4ff8cb595b38a6e908 (patch) | |
tree | 07879b2693eb528438d31855e30401c24b6f756b /src/liblzma/common | |
parent | Build: Fix "make check" on Windows. (diff) | |
download | xz-6b620a0f0813d28c3c544b4ff8cb595b38a6e908.tar.xz |
liblzma: Fix a deadlock in the threaded encoder.
It was triggered when reinitializing the encoder,
e.g. when encoding two files.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/common/stream_encoder_mt.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) |