summaryrefslogtreecommitdiffstats
path: root/src/xz/hardware.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-15 09:41:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-15 09:41:34 +0000
commitcf178685aca107aa37c748de11da01562e78c46c (patch)
tree84d60b39c1744edcbdd4dbfc5026583914432dba /src/xz/hardware.c
parentAdding upstream version 5.6.1+really5.4.5. (diff)
downloadxz-utils-cf178685aca107aa37c748de11da01562e78c46c.tar.xz
xz-utils-cf178685aca107aa37c748de11da01562e78c46c.zip
Adding upstream version 5.6.2.upstream/5.6.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/xz/hardware.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/xz/hardware.c b/src/xz/hardware.c
index c694882..952652f 100644
--- a/src/xz/hardware.c
+++ b/src/xz/hardware.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file hardware.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -15,7 +14,7 @@
/// Maximum number of worker threads. This can be set with
/// the --threads=NUM command line option.
-static uint32_t threads_max = 1;
+static uint32_t threads_max;
/// True when the number of threads is automatically determined based
/// on the available hardware threads.
@@ -334,5 +333,9 @@ hardware_init(void)
memlimit_mt_default = mem_ceiling;
#endif
+ // Enable threaded mode by default. xz 5.4.x and older
+ // used single-threaded mode by default.
+ hardware_threads_set(0);
+
return;
}