diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index d9bd9325a..83facff91 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -5778,17 +5778,9 @@ void multiSlsDetector::readFrameFromReceiver(){ int* multiframe=new int[nel](); int nch; + bool runningList[numSockets]; bool connectList[numSockets]; - - int numRunning = 0; - - //wait for real time acquisition to start - bool running = true; - sem_wait(&sem_newRTAcquisition); - if(checkJoinThread()) - running = false; - for(int i = 0; i < numSockets; ++i) { if(!zmqSocket[i]->Connect()) { connectList[i] = true; @@ -5799,8 +5791,14 @@ void multiSlsDetector::readFrameFromReceiver(){ runningList[i] = false; } } + int numRunning = numSockets; - numRunning = numSockets; + + //wait for real time acquisition to start + bool running = true; + sem_wait(&sem_newRTAcquisition); + if(checkJoinThread()) + running = false; //exit when last message for each socket received