]> git.ipfire.org Git - thirdparty/xz.git/commit
liblzma: mt dec: Fix lack of parallelization in single-shot decoding
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 3 Apr 2025 11:34:42 +0000 (14:34 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 4 Apr 2025 11:52:05 +0000 (14:52 +0300)
commit20ec36eafddd7b3a0e014e1f4ed1b87a9105a725
tree7995f437b01f7c73d05e3754b8f3fb4be3673e3f
parentc8bb46c5a16ed02401f4a0b46c74f0f46c1b6434
liblzma: mt dec: Fix lack of parallelization in single-shot decoding

Single-shot decoding means calling lzma_code() by giving it the whole
input at once and enough output buffer space to store the uncompressed
data, and combining this with LZMA_FINISH and no timeout
(lzma_mt.timeout = 0). This way the file is decoded with a single
lzma_code() call if possible.

The bug prevented the decoder from starting more than one worker thread
in single-shot mode. The issue was noticed when reviewing the code;
there are no bug reports. Thus maybe few have tried this mode.

Fixes: 64b6d496dc81 ("liblzma: Threaded decoder: Always wait for output if LZMA_FINISH is used.")
(cherry picked from commit 0c80045ab82c406858d9d5bcea9f48ebc3d0a81d)
src/liblzma/common/stream_decoder_mt.c