From 697f9a50fe00cfa7e9713cfd8d0662f020ca6d18 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 9 Dec 2020 12:21:31 -0500 Subject: [PATCH] Terminate thread also when zm_terminate is true --- src/zm_analysis_thread.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zm_analysis_thread.cpp b/src/zm_analysis_thread.cpp index 58f532142..c7a5dbf55 100644 --- a/src/zm_analysis_thread.cpp +++ b/src/zm_analysis_thread.cpp @@ -25,7 +25,7 @@ int AnalysisThread::run() { monitor->get_ref_image(); Debug(2, "THREAD: after Getting ref image"); - while ( !terminate ) { + while ( !(terminate or zm_terminate) ) { // Process the next image //sigprocmask(SIG_BLOCK, &block_set, 0); @@ -41,10 +41,10 @@ int AnalysisThread::run() { Debug(2, "Analyzing"); if ( !monitor->Analyse() ) { -Debug(2, "Sleeping for %d", monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE); +Debug(2, "uSleeping for %d", 10*(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); usleep(10*(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); } else if ( analysis_rate ) { -Debug(2, "Sleeping for %d", analysis_rate); +Debug(2, "uSleeping for %d", analysis_rate); usleep(analysis_rate); } else { Debug(2, "Not Sleeping");