]> 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:53:00 +0000 (14:53 +0300)
commit2e918d09ad01cc83911eac7147c3d7d8c7f6bd9a
treedcc34c4312d362728dda04fd56201b4d5281bf57
parent6ff5b8c55960f9ebc917b668bd3567ef217175fa
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