mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 14:57:13 +02:00
two acquires at the same tiem should not be possile. using shared memory to set flag, made all connect use the standard connectControl etc
This commit is contained in:
@ -41,7 +41,18 @@ slsDetectorUtils::slsDetectorUtils() {
|
||||
|
||||
|
||||
|
||||
void slsDetectorUtils::acquire(int delflag){
|
||||
int slsDetectorUtils::acquire(int delflag){
|
||||
|
||||
//ensure acquire isnt started multiple times by same client
|
||||
pthread_mutex_lock(&mp);
|
||||
if(getAcquiringFlag() == false)
|
||||
setAcquiringFlag(true);
|
||||
else{
|
||||
std::cout << "Error: Acquire has already been started." << std::endl;
|
||||
return FAIL;
|
||||
}
|
||||
pthread_mutex_unlock(&mp);
|
||||
|
||||
|
||||
bool receiver = (setReceiverOnline()==ONLINE_FLAG);
|
||||
if(!receiver){
|
||||
@ -526,6 +537,10 @@ void slsDetectorUtils::acquire(int delflag){
|
||||
#ifdef VERBOSE
|
||||
cout << "acquisition finished callback done " << endl;
|
||||
#endif
|
||||
|
||||
setAcquiringFlag(false);
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user