]> 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>
Thu, 3 Apr 2025 11:34:42 +0000 (14:34 +0300)
commit0c80045ab82c406858d9d5bcea9f48ebc3d0a81d
treec8b1da35470dbaa6cb4a0f5e28a7753fd17e19c8
parent8188048854e8d11071b8a50d093c74f4c030acc9
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.")
src/liblzma/common/stream_decoder_mt.c