mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-18 15:57:13 +02:00
semaphores , no usleep in receiver
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@660 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -311,8 +311,9 @@ void slsDetectorUtils::acquire(int delflag){
|
||||
break;
|
||||
|
||||
|
||||
pthread_mutex_lock(&mg);
|
||||
|
||||
if(setReceiverOnline()==OFFLINE_FLAG){
|
||||
pthread_mutex_lock(&mg);
|
||||
// wait until data processing thread has finished the data
|
||||
|
||||
#ifdef VERBOSE
|
||||
@ -329,11 +330,21 @@ void slsDetectorUtils::acquire(int delflag){
|
||||
if((*correctionMask)&(1<<WRITE_FILE))
|
||||
closeDataFile();
|
||||
}
|
||||
|
||||
}else
|
||||
stopReceiver();
|
||||
|
||||
pthread_mutex_unlock(&mg);
|
||||
}else{
|
||||
pthread_mutex_lock(&mg);
|
||||
if(startReceiverReadout() == TRANSMITTING){
|
||||
while(getReceiverStatus() != RUN_FINISHED){
|
||||
pthread_mutex_unlock(&mg);
|
||||
usleep(50000);
|
||||
pthread_mutex_lock(&mg);
|
||||
}
|
||||
}
|
||||
stopReceiver();
|
||||
pthread_mutex_unlock(&mg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user