aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2014-06-18 22:04:24 +0300
committerLasse Collin <lasse.collin@tukaani.org>2014-06-18 22:04:24 +0300
commita115cc3748482e277f42a968baa3cd266f031dba (patch)
tree54cf051c55d0aadd67a5b2d5a9edb6b57a09c787 /src/liblzma/common
parentxz: Check for filter chain compatibility for --flush-timeout. (diff)
downloadxz-a115cc3748482e277f42a968baa3cd266f031dba.tar.xz
liblzma: Add lzma_cputhreads().
Diffstat (limited to 'src/liblzma/common')
-rw-r--r--src/liblzma/common/Makefile.inc1
-rw-r--r--src/liblzma/common/hardware_cputhreads.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/src/liblzma/common/Makefile.inc b/src/liblzma/common/Makefile.inc
index 76432767..8f54a97a 100644
--- a/src/liblzma/common/Makefile.inc
+++ b/src/liblzma/common/Makefile.inc
@@ -44,6 +44,7 @@ liblzma_la_SOURCES += \
if COND_THREADS
liblzma_la_SOURCES += \
+ common/hardware_cputhreads.c \
common/outqueue.c \
common/outqueue.h \
common/stream_encoder_mt.c
diff --git a/src/liblzma/common/hardware_cputhreads.c b/src/liblzma/common/hardware_cputhreads.c
new file mode 100644
index 00000000..f468366a
--- /dev/null
+++ b/src/liblzma/common/hardware_cputhreads.c
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file hardware_cputhreads.c
+/// \brief Get the number of CPU threads or cores
+//
+// Author: Lasse Collin
+//
+// This file has been put into the public domain.
+// You can do whatever you want with this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "common.h"
+
+#include "tuklib_cpucores.h"
+
+
+extern LZMA_API(uint32_t)
+lzma_cputhreads(void)
+{
+ return tuklib_cpucores();
+}