diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2014-06-18 22:04:24 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2014-06-18 22:04:24 +0300 |
commit | a115cc3748482e277f42a968baa3cd266f031dba (patch) | |
tree | 54cf051c55d0aadd67a5b2d5a9edb6b57a09c787 /src/liblzma/common | |
parent | xz: Check for filter chain compatibility for --flush-timeout. (diff) | |
download | xz-a115cc3748482e277f42a968baa3cd266f031dba.tar.xz |
liblzma: Add lzma_cputhreads().
Diffstat (limited to 'src/liblzma/common')
-rw-r--r-- | src/liblzma/common/Makefile.inc | 1 | ||||
-rw-r--r-- | src/liblzma/common/hardware_cputhreads.c | 22 |
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(); +} |