diff --git a/src/zm_analysis_thread.cpp b/src/zm_analysis_thread.cpp index c207f7fd5..148b6571b 100644 --- a/src/zm_analysis_thread.cpp +++ b/src/zm_analysis_thread.cpp @@ -11,18 +11,17 @@ AnalysisThread::AnalysisThread(Monitor *monitor) : AnalysisThread::~AnalysisThread() { Stop(); - if (thread_.joinable()) - thread_.join(); + if (thread_.joinable()) thread_.join(); } void AnalysisThread::Start() { + if (thread_.joinable()) thread_.join(); terminate_ = false; + Debug(3, "Starting analysis thread"); thread_ = std::thread(&AnalysisThread::Run, this); } void AnalysisThread::Run() { - Debug(2, "AnalysisThread::Run() for %d", monitor_->Id()); - Microseconds analysis_rate = Microseconds(monitor_->GetAnalysisRate()); Seconds analysis_update_delay = Seconds(monitor_->GetAnalysisUpdateDelay()); Debug(2, "AnalysisThread::Run() have update delay %d", analysis_update_delay); diff --git a/src/zm_decoder_thread.cpp b/src/zm_decoder_thread.cpp index 2bf1f3c2b..d32a578c7 100644 --- a/src/zm_decoder_thread.cpp +++ b/src/zm_decoder_thread.cpp @@ -10,11 +10,11 @@ DecoderThread::DecoderThread(Monitor *monitor) : DecoderThread::~DecoderThread() { Stop(); - if (thread_.joinable()) - thread_.join(); + if (thread_.joinable()) thread_.join(); } void DecoderThread::Start() { + if (thread_.joinable()) thread_.join(); terminate_ = false; thread_ = std::thread(&DecoderThread::Run, this); }