summaryrefslogtreecommitdiffstats
path: root/src/ManagementServer.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-19 11:37:09 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-19 11:37:09 +0100
commita48f80b33a9859da52dfbcebf0bc69e80c1bb8e5 (patch)
tree51fb7b8569f724579111edddaf146abfb501449f /src/ManagementServer.h
parenteff41c50e52d6ce7ef1d3d7be8072a6c27875df4 (diff)
downloaddabmux-a48f80b33a9859da52dfbcebf0bc69e80c1bb8e5.tar.gz
dabmux-a48f80b33a9859da52dfbcebf0bc69e80c1bb8e5.tar.bz2
dabmux-a48f80b33a9859da52dfbcebf0bc69e80c1bb8e5.zip
Replace boost thread in ManagementServer
Diffstat (limited to 'src/ManagementServer.h')
-rw-r--r--src/ManagementServer.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ManagementServer.h b/src/ManagementServer.h
index 885565a..f8d722e 100644
--- a/src/ManagementServer.h
+++ b/src/ManagementServer.h
@@ -56,7 +56,8 @@
#include <atomic>
#include <chrono>
#include <deque>
-#include <boost/thread.hpp>
+#include <thread>
+#include <mutex>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <cmath>
@@ -128,7 +129,7 @@ class InputStat
std::chrono::time_point<std::chrono::steady_clock> m_time_last_event;
// The mutex that has to be held during all notify and readout
- mutable boost::mutex m_mutex;
+ mutable std::mutex m_mutex;
};
class ManagementServer
@@ -144,8 +145,6 @@ class ManagementServer
{
m_running = false;
m_fault = false;
-
- // TODO notify
m_thread.join();
}
@@ -156,7 +155,7 @@ class ManagementServer
{
m_listenport = listenport;
if (m_listenport > 0) {
- m_thread = boost::thread(&ManagementServer::serverThread, this);
+ m_thread = std::thread(&ManagementServer::serverThread, this);
}
}
@@ -195,8 +194,8 @@ class ManagementServer
// serverThread runs in a separate thread
std::atomic<bool> m_running;
std::atomic<bool> m_fault;
- boost::thread m_thread;
- boost::thread m_restarter_thread;
+ std::thread m_thread;
+ std::thread m_restarter_thread;
/******* Statistics Data ********/
std::map<std::string, InputStat*> m_inputStats;
@@ -215,10 +214,10 @@ class ManagementServer
std::string getValuesJSON();
// mutex for accessing the map
- boost::mutex m_statsmutex;
+ std::mutex m_statsmutex;
/******** Configuration Data *******/
- boost::mutex m_configmutex;
+ std::mutex m_configmutex;
boost::property_tree::ptree m_pt;
};