diff --git a/CMakeLists.txt b/CMakeLists.txt index 829e2cbafda41e8a1c7b94f1a37656e2d79a64f4..7ff7e868a52f958c7a304b73a022576a88039b18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,6 +153,7 @@ list (APPEND opendht_SOURCES src/peer_discovery.cpp src/network_utils.h src/network_utils.cpp + src/thread_pool.cpp ) list (APPEND opendht_HEADERS @@ -177,6 +178,7 @@ list (APPEND opendht_HEADERS include/opendht/log.h include/opendht/log_enable.h include/opendht/peer_discovery.h + include/opendht/thread_pool.h include/opendht.h ) @@ -199,8 +201,6 @@ if (OPENDHT_PROXY_SERVER) include/opendht/dht_proxy_server.h ) list (APPEND opendht_SOURCES - src/thread_pool.h - src/thread_pool.cpp src/dht_proxy_server.cpp ) endif () diff --git a/src/thread_pool.h b/include/opendht/thread_pool.h similarity index 97% rename from src/thread_pool.h rename to include/opendht/thread_pool.h index 0ece5ac242a76df1e8ecf486cffac60db08f6505..814c14f38e35f071bf251c6383e86abf81cd4b66 100644 --- a/src/thread_pool.h +++ b/include/opendht/thread_pool.h @@ -19,6 +19,8 @@ #pragma once +#include "def.h" + #include <condition_variable> #include <vector> #include <queue> @@ -27,7 +29,7 @@ namespace dht { -class ThreadPool { +class OPENDHT_PUBLIC ThreadPool { public: static ThreadPool& computation(); static ThreadPool& io(); diff --git a/src/Makefile.am b/src/Makefile.am index 04d31b875e65842f9c291cd5eaf8332bf96b1e28..01ffb1c79e0225a50f60e4967328e11612f3c039 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,8 @@ libopendht_la_SOURCES = \ log.cpp \ peer_discovery.cpp \ network_utils.h \ - network_utils.cpp + network_utils.cpp \ + thread_pool.cpp if WIN32 libopendht_la_SOURCES += rng.cpp @@ -57,10 +58,11 @@ nobase_include_HEADERS = \ ../include/opendht/log.h \ ../include/opendht/log_enable.h \ ../include/opendht/peer_discovery.h \ - ../include/opendht/rng.h + ../include/opendht/rng.h \ + ../include/opendht/thread_pool.h if ENABLE_PROXY_SERVER -libopendht_la_SOURCES += dht_proxy_server.cpp thread_pool.h thread_pool.cpp +libopendht_la_SOURCES += dht_proxy_server.cpp nobase_include_HEADERS += ../include/opendht/dht_proxy_server.h endif