mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
liblzma: Fix a deadlock in the threaded encoder.
It was triggered when reinitializing the encoder, e.g. when encoding two files.
This commit is contained in:
parent
bd52cf150e
commit
6b620a0f08
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue