mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
xz: Force single-threaded mode when --flush-timeout is used.
This commit is contained in:
parent
87f1a24810
commit
8c19216bac
1 changed files with 11 additions and 0 deletions
|
@ -195,6 +195,17 @@ coder_set_compression_settings(void)
|
|||
// Print the selected filter chain.
|
||||
message_filters_show(V_DEBUG, filters);
|
||||
|
||||
// Disable encoder threads when --flush-timeout is used because
|
||||
// the threaded encoder doesn't support LZMA_SYNC_FLUSH.
|
||||
// FIXME: When LZMA_SYNC_FLUSH is supported, this should be changed.
|
||||
if (opt_mode == MODE_COMPRESS && opt_flush_timeout != 0
|
||||
&& hardware_threads_get() > 1) {
|
||||
message(V_WARNING, _("Switching to single-threaded mode "
|
||||
"due to --flush-timeout=%" PRIu64),
|
||||
opt_flush_timeout);
|
||||
hardware_threads_set(1);
|
||||
}
|
||||
|
||||
// Get the memory usage. Note that if --format=raw was used,
|
||||
// we can be decompressing.
|
||||
const uint64_t memory_limit = hardware_memlimit_get(opt_mode);
|
||||
|
|
Loading…
Reference in a new issue