aboutsummaryrefslogtreecommitdiffstats
path: root/src/RemoteControl.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-04-11 15:54:34 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-04-11 15:54:34 +0200
commit00d7d4141614ef295d8bbfeece0e9dc11152a6ae (patch)
treeca6825ef236a483404c05973974d5df5b6a34ce0 /src/RemoteControl.cpp
parenta1bd2965c58806dd9c2d0323b1f97deeff2f048f (diff)
parent9a1f5fa40020247ed25fbe553d2ce71fa53d9e95 (diff)
downloaddabmod-00d7d4141614ef295d8bbfeece0e9dc11152a6ae.tar.gz
dabmod-00d7d4141614ef295d8bbfeece0e9dc11152a6ae.tar.bz2
dabmod-00d7d4141614ef295d8bbfeece0e9dc11152a6ae.zip
Merge branch 'next' into easydabv3
Diffstat (limited to 'src/RemoteControl.cpp')
-rw-r--r--src/RemoteControl.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp
index 6e6a7e9..a3d9ec3 100644
--- a/src/RemoteControl.cpp
+++ b/src/RemoteControl.cpp
@@ -53,6 +53,10 @@ RemoteControllerTelnet::~RemoteControllerTelnet()
void RemoteControllerTelnet::restart()
{
+ if (m_restarter_thread.joinable()) {
+ m_restarter_thread.join();
+ }
+
m_restarter_thread = std::thread(
&RemoteControllerTelnet::restart_thread,
this, 0);
@@ -105,7 +109,9 @@ void RemoteControllerTelnet::restart_thread(long)
m_active = false;
m_io_service.stop();
- m_child_thread.join();
+ if (m_child_thread.joinable()) {
+ m_child_thread.join();
+ }
m_child_thread = std::thread(&RemoteControllerTelnet::process, this, 0);
}
@@ -342,6 +348,10 @@ RemoteControllerZmq::~RemoteControllerZmq() {
void RemoteControllerZmq::restart()
{
+ if (m_restarter_thread.joinable()) {
+ m_restarter_thread.join();
+ }
+
m_restarter_thread = std::thread(&RemoteControllerZmq::restart_thread, this);
}