1
0
Fork 0
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:
Lasse Collin 2011-10-23 17:05:55 +03:00
parent bd52cf150e
commit 6b620a0f08

View file

@ -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)