-+ mutex_unlock(&ctx->mutex);
-+ wait_event(ctx->next_req, unlzma_should_stop(ctx) || (*avail > 0));
-+ mutex_lock(&ctx->mutex);
++ do {
++ mutex_unlock(&ctx->mutex);
++ if (wait_event_interruptible(ctx->next_req,
++ unlzma_should_stop(ctx) || (*avail > 0)))
++ schedule();
++ mutex_lock(&ctx->mutex);
++ } while (*avail <= 0 && !unlzma_should_stop(ctx));
++
++ if (!unlzma_should_stop(ctx) && ctx->buf_full)
++ get_buffer(ctx);