From 7b431bed513db3318811698029304d81e5831ab3 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sun, 22 Jul 2018 22:35:58 +0100 Subject: cIsThread: Reset m_ShouldTerminate after the thread has stopped (#4258) This allows threads to be restarted after stopping. Fixes #4257 --- src/OSSupport/IsThread.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/OSSupport') diff --git a/src/OSSupport/IsThread.cpp b/src/OSSupport/IsThread.cpp index 3f75951ba..d60d0d9eb 100644 --- a/src/OSSupport/IsThread.cpp +++ b/src/OSSupport/IsThread.cpp @@ -60,8 +60,7 @@ cIsThread::cIsThread(const AString & a_ThreadName) : cIsThread::~cIsThread() { - m_ShouldTerminate = true; - Wait(); + Stop(); } @@ -110,14 +109,9 @@ bool cIsThread::Start(void) void cIsThread::Stop(void) { - if (!m_Thread.joinable()) - { - // The thread hasn't been started or has already been joined - return; - } - m_ShouldTerminate = true; Wait(); + m_ShouldTerminate = false; } -- cgit v1.2.3