From 40f6eb8edeb61989cdf47cd044a57d8aed2d8dde Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Tue, 17 Nov 2020 15:33:09 +0100 Subject: [PATCH] WIP --- slsDetectorSoftware/src/CmdLineApp.cpp | 6 +++--- slsDetectorSoftware/src/DetectorImpl.cpp | 4 ++++ slsReceiverSoftware/src/ReceiverApp2.cpp | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/slsDetectorSoftware/src/CmdLineApp.cpp b/slsDetectorSoftware/src/CmdLineApp.cpp index ad289097b..bf010971e 100644 --- a/slsDetectorSoftware/src/CmdLineApp.cpp +++ b/slsDetectorSoftware/src/CmdLineApp.cpp @@ -64,13 +64,13 @@ int main(int argc, char *argv[]) { } try { - // How big should this try block be? sls::Detector det(parser.multi_id()); sls::CmdProxy proxy(&det); proxy.Call(parser.command(), parser.arguments(), parser.detector_id(), action); } catch (const sls::RuntimeError &e) { - // OK to catch and do nothing since this will print the error message - // and command line app will anyway exit + exit(EXIT_FAILURE); } + + exit(EXIT_SUCCESS); } \ No newline at end of file diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 5c5e029bc..daa81f997 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1126,6 +1126,10 @@ int DetectorImpl::acquire() { (end.tv_nsec - begin.tv_nsec) / 1000000000.0) << " seconds"; } catch (...) { + if (dataProcessingThread.joinable()){ + setJoinThreadFlag(true); + dataProcessingThread.join(); + } setAcquiringFlag(false); throw; } diff --git a/slsReceiverSoftware/src/ReceiverApp2.cpp b/slsReceiverSoftware/src/ReceiverApp2.cpp index 252d2f12b..0371fb368 100644 --- a/slsReceiverSoftware/src/ReceiverApp2.cpp +++ b/slsReceiverSoftware/src/ReceiverApp2.cpp @@ -28,8 +28,8 @@ int StartAcq(std::string filepath, std::string filename, uint64_t fileindex, << " filename:" << filename << " fileindex:" << fileindex << " datasize:" << datasize << " ####"; - /*throw std::runtime_error( - "Throwing exception from start acquisition call back");*/ + // throw std::runtime_error( + // "Throwing exception from start acquisition call back"); return 0; }