diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-20 16:46:22 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-21 17:29:18 +0100 |
commit | a18f724aa3bf57aeed285b5f61eca4a0ba891c21 (patch) | |
tree | ce90fb7fd9494f340efc3416ab769353d480f82b /lib/util/Makemodule.am | |
parent | 977aa1d0d29b5b48b31279d7709a7209001ee309 (diff) |
Add a thread pool implementation to libutil
The thread pool enforces ordering of items during dequeue similar
to the already existing implementation in libsqfs. The idea is to
eventually pull this functionality out of the block processor and
turn it into a cleaner, separately tested module.
The thread pool is implemented as an abstract interface, so we can
have multiple implementations around, including the serial fallback
implementation which we can then *always* test, irregardless of the
compile config and run through static analysis as well.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/util/Makemodule.am')
-rw-r--r-- | lib/util/Makemodule.am | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/util/Makemodule.am b/lib/util/Makemodule.am index 39352f4..113855c 100644 --- a/lib/util/Makemodule.am +++ b/lib/util/Makemodule.am @@ -4,9 +4,27 @@ libutil_a_SOURCES += lib/util/rbtree.c include/rbtree.h libutil_a_SOURCES += lib/util/array.c include/array.h libutil_a_SOURCES += lib/util/xxhash.c lib/util/hash_table.c libutil_a_SOURCES += lib/util/fast_urem_by_const.h +libutil_a_SOURCES += include/threadpool.h +libutil_a_SOURCES += include/w32threadwrap.h +libutil_a_SOURCES += lib/util/threadpool_serial.c libutil_a_CFLAGS = $(AM_CFLAGS) libutil_a_CPPFLAGS = $(AM_CPPFLAGS) +if WINDOWS +libutil_a_CFLAGS += -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 +endif + +if HAVE_PTHREAD +libutil_a_SOURCES += lib/util/threadpool.c +libutil_a_CFLAGS += $(PTHREAD_CFLAGS) +else +if WINDOWS +libutil_a_SOURCES += lib/util/threadpool.c +else +libutil_a_CPPFLAGS += -DNO_THREAD_IMPL +endif +endif + if CUSTOM_ALLOC libutil_a_SOURCES += lib/util/mempool.c include/mempool.h endif |