]> git.ipfire.org Git - thirdparty/xz.git/commit
liblzma: mt dec: Simplify by removing the THR_STOP state
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 12:49:41 +0000 (15:49 +0300)
commitf74cf18ad084a9185d8ae148d89265860aa8004c
tree2f3ca7ee5c8fcf0da7ed20fbdf70f7a34246c4da
parentc1a91b8baeb947c5b232a6c3d6319267131830bc
liblzma: mt dec: Simplify by removing the THR_STOP state

The main thread can directly set THR_IDLE in threads_stop() which is
called when errors are detected. threads_stop() won't return the stopped
threads to the pool or free the memory pointed by thr->in anymore, but
it doesn't matter because the existing workers won't be reused after
an error. The resources will be cleaned up when threads_end() is
called (reinitializing the decoder always calls threads_end()).

Reviewed-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Thanks-to: Sam James <sam@gentoo.org>
(cherry picked from commit c0c835964dfaeb2513a3c0bdb642105152fe9f34)
src/liblzma/common/stream_decoder_mt.c