From a48f80b33a9859da52dfbcebf0bc69e80c1bb8e5 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 19 Feb 2018 11:37:09 +0100 Subject: Replace boost thread in ManagementServer --- src/ManagementServer.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/ManagementServer.h') 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 #include #include -#include +#include +#include #include #include #include @@ -128,7 +129,7 @@ class InputStat std::chrono::time_point 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 m_running; std::atomic m_fault; - boost::thread m_thread; - boost::thread m_restarter_thread; + std::thread m_thread; + std::thread m_restarter_thread; /******* Statistics Data ********/ std::map 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; }; -- cgit v1.2.3