Merge branch 'callbacksafe' of github.com:slsdetectorgroup/slsDetectorPackage into callbacksafe

This commit is contained in:
maliakal_d 2020-11-17 16:12:39 +01:00
commit d2eed6177c
3 changed files with 9 additions and 5 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}