mirror of https://git.tukaani.org/xz.git
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
|
@ -295,8 +295,10 @@ worker_start(void *thr_ptr)
|
||||||
while (true) {
|
while (true) {
|
||||||
// The thread is already idle so if we are
|
// The thread is already idle so if we are
|
||||||
// requested to stop, just set the state.
|
// requested to stop, just set the state.
|
||||||
if (thr->state == THR_STOP)
|
if (thr->state == THR_STOP) {
|
||||||
thr->state = THR_IDLE;
|
thr->state = THR_IDLE;
|
||||||
|
pthread_cond_signal(&thr->cond);
|
||||||
|
}
|
||||||
|
|
||||||
state = thr->state;
|
state = thr->state;
|
||||||
if (state != THR_IDLE)
|
if (state != THR_IDLE)
|
||||||
|
|
Loading…
Reference in New Issue