mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
creating and destroying sockets for each receiver start and stop in a single acquisition (to deal with scans etc)
This commit is contained in:
@ -173,9 +173,11 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
|
||||
|
||||
if (*threadedProcessing) {
|
||||
if(dataReady)
|
||||
sem_init(&dataThreadStartedSemaphore,1,0);
|
||||
startThread(delflag);
|
||||
sem_init(&dataThreadStartedSemaphore,1,0);
|
||||
startThread(delflag);
|
||||
|
||||
if(dataReady)
|
||||
createReceivingDataThreads();
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
cout << " starting thread " << endl;
|
||||
@ -186,9 +188,6 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
resetFramesCaught();
|
||||
}
|
||||
|
||||
if(*threadedProcessing && dataReady)
|
||||
sem_wait(&dataThreadStartedSemaphore);
|
||||
|
||||
for(int im=0;im<nm;im++) {
|
||||
|
||||
#ifdef VERBOSE
|
||||
@ -315,6 +314,11 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
break;
|
||||
}
|
||||
pthread_mutex_unlock(&mg);
|
||||
//start the receiving sockets in their threads
|
||||
if(*threadedProcessing && dataReady){
|
||||
startReceivingData();
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
cout << "Acquiring " << endl;
|
||||
@ -484,13 +488,18 @@ int slsDetectorUtils::acquire(int delflag){
|
||||
#ifdef VERBOSE
|
||||
cout << "wait for data processing thread" << endl;
|
||||
#endif
|
||||
if(dataReady){
|
||||
//if mask is not cleared, clear it
|
||||
}
|
||||
setJoinThread(1);
|
||||
pthread_join(dataProcessingThread, &status);
|
||||
#ifdef VERBOSE
|
||||
cout << "data processing thread joined" << endl;
|
||||
#endif
|
||||
if(dataReady)
|
||||
if(dataReady){
|
||||
createReceivingDataThreads(true);
|
||||
sem_destroy(&dataThreadStartedSemaphore);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user