aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_encoder_mt.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-07-12liblzma: Check the return value of lzma_index_append() in threaded encoder.Lasse Collin1-2/+5
If lzma_index_append() failed (most likely memory allocation failure) it could have gone unnoticed and the resulting .xz file would have an incorrect Index. Decompressing such a file would produce the correct uncompressed data but then an error would occur when verifying the Index field.
2019-12-31liblzma: Add a comment.Lasse Collin1-1/+1
2019-07-13spellingAntoine Cœur1-1/+1
2016-12-28liblzma: Avoid multiple definitions of lzma_coder structures.Lasse Collin1-56/+68
Only one definition was visible in a translation unit. It avoided a few casts and temp variables but seems that this hack doesn't work with link-time optimizations in compilers as it's not C99/C11 compliant. Fixes: http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html
2014-11-25liblzma: Verify the filter chain in threaded encoder initialization.Lasse Collin1-3/+6
This way an invalid filter chain is detected at the Stream encoder initialization instead of delaying it to the first call to lzma_code() which triggers the initialization of the actual filter encoder(s).
2014-11-10liblzma: Fix lzma_mt.preset in lzma_stream_encoder_mt_memusage().Lasse Collin1-2/+1
It read the filter chain from a wrong variable. This is a similar bug that was fixed in 9494fb6d0ff41c585326f00aa8f7fe58f8106a5e.
2014-01-29liblzma: Fix lzma_mt.preset not working with lzma_stream_encoder_mt().Lasse Collin1-2/+2
It read the filter chain from a wrong variable.
2013-10-02liblzma: Support LZMA_FULL_FLUSH and _BARRIER in threaded encoder.Lasse Collin1-16/+39
Now --block-list=SIZES works with in the threaded mode too, although the performance is still bad due to the use of LZMA_FULL_FLUSH instead of the new LZMA_FULL_BARRIER.
2013-09-17Add native threading support on Windows.Lasse Collin1-47/+36
Now liblzma only uses "mythread" functions and types which are defined in mythread.h matching the desired threading method. Before Windows Vista, there is no direct equivalent to pthread condition variables. Since this package doesn't use pthread_cond_broadcast(), pre-Vista threading can still be kept quite simple. The pre-Vista code doesn't use anything that wasn't already available in Windows 95, so the binaries should run even on Windows 95 if someone happens to care.
2013-06-23liblzma: Avoid a warning about a shadowed variable.Lasse Collin1-2/+2
On Mac OS X wait() is declared in <sys/wait.h> that we include one way or other so don't use "wait" as a variable name. Thanks to Christian Kujau.
2013-03-23liblzma: Use lzma_block_buffer_bound64() in threaded encoder.Lasse Collin1-16/+50
Now it uses lzma_block_uncomp_encode() if the data doesn't fit into the space calculated by lzma_block_buffer_bound64().
2013-03-23liblzma: Fix another deadlock in the threaded encoder.Lasse Collin1-3/+6
This race condition could cause a deadlock if lzma_end() was called before finishing the encoding. This can happen with xz with debugging enabled (non-debugging version doesn't call lzma_end() before exiting).
2012-12-14Make the progress indicator smooth in threaded mode.Lasse Collin1-5/+72
This adds lzma_get_progress() to liblzma and takes advantage of it in xz. lzma_get_progress() collects progress information from the thread-specific structures so that fairly accurate progress information is available to applications. Adding a new function seemed to be a better way than making the information directly available in lzma_stream (like total_in and total_out are) because collecting the information requires locking mutexes. It's waste of time to do it more often than the up to date information is actually needed by an application.
2012-07-17liblzma: Make the use of lzma_allocator const-correct.Lasse Collin1-8/+8
There is a tiny risk of causing breakage: If an application assigns lzma_stream.allocator to a non-const pointer, such code won't compile anymore. I don't know why anyone would do such a thing though, so in practice this shouldn't cause trouble. Thanks to Jan Kratochvil for the patch.
2011-10-23liblzma: Fix a deadlock in the threaded encoder.Lasse Collin1-1/+3
It was triggered when reinitializing the encoder, e.g. when encoding two files.
2011-04-11liblzma: Add lzma_stream_encoder_mt() for threaded compression.Lasse Collin1-0/+1011
This is the simplest method to do threading, which splits the uncompressed data into blocks and compresses them independently from each other. There's room for improvement especially to reduce the memory usage, but nevertheless, this is a good start.