From 2d1c91c0e0269073b01f5d729a5696e131175a2e Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Fri, 16 Dec 2016 14:59:55 +0100 Subject: [PATCH] bug in sem for new scans --- slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp index f30567572..0e6d5e763 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.cpp @@ -471,8 +471,6 @@ int slsDetectorUtils::acquire(int delflag){ } - //let processing thread continue and checkjointhread - sem_post(&sem_newRTAcquisition); // waiting for the data processing thread to finish! if (*threadedProcessing) { @@ -480,6 +478,10 @@ int slsDetectorUtils::acquire(int delflag){ cout << "wait for data processing thread" << endl; #endif setJoinThread(1); + + //let processing thread continue and checkjointhread + sem_post(&sem_newRTAcquisition); + pthread_join(dataProcessingThread, &status); #ifdef VERBOSE cout << "data processing thread joined" << endl;