From 91a81f64ac42be01136b2d64cb960601c9882eaf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Sun, 21 Apr 2019 21:39:42 -0400
Subject: [PATCH] thread pool: make public

---
 CMakeLists.txt                         | 4 ++--
 {src => include/opendht}/thread_pool.h | 4 +++-
 src/Makefile.am                        | 8 +++++---
 3 files changed, 10 insertions(+), 6 deletions(-)
 rename {src => include/opendht}/thread_pool.h (97%)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 829e2cba..7ff7e868 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 0ece5ac2..814c14f3 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 04d31b87..01ffb1c7 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
 
-- 
GitLab