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
1 changed files with 3 additions and 1 deletions

View File

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