Don't join in Stop methods. THe decode and analysis thread may never get woken up from packetqueue. Leave it for the destructor.
parent
c51c287c01
commit
0d03266455
|
@ -11,6 +11,7 @@ AnalysisThread::AnalysisThread(Monitor *monitor) :
|
|||
|
||||
AnalysisThread::~AnalysisThread() {
|
||||
Stop();
|
||||
if (thread_.joinable()) thread_.join();
|
||||
}
|
||||
|
||||
void AnalysisThread::Start() {
|
||||
|
@ -22,7 +23,6 @@ void AnalysisThread::Start() {
|
|||
|
||||
void AnalysisThread::Stop() {
|
||||
terminate_ = true;
|
||||
if (thread_.joinable()) thread_.join();
|
||||
}
|
||||
|
||||
void AnalysisThread::Run() {
|
||||
|
|
|
@ -10,6 +10,7 @@ DecoderThread::DecoderThread(Monitor *monitor) :
|
|||
|
||||
DecoderThread::~DecoderThread() {
|
||||
Stop();
|
||||
if (thread_.joinable()) thread_.join();
|
||||
}
|
||||
|
||||
void DecoderThread::Start() {
|
||||
|
@ -20,7 +21,6 @@ void DecoderThread::Start() {
|
|||
|
||||
void DecoderThread::Stop() {
|
||||
terminate_ = true;
|
||||
if (thread_.joinable()) thread_.join();
|
||||
}
|
||||
|
||||
void DecoderThread::Run() {
|
||||
|
|
Loading…
Reference in New Issue