make it work for multi threaded compression receiver for moench only

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@721 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2014-01-30 16:40:28 +00:00
parent b7bc8fd8e5
commit c0ed0e231d

View File

@ -210,6 +210,12 @@ public:
*/ */
int stopReceiver(); int stopReceiver();
/**
* Closes all files
* @param ithr thread index
*/
void closeFile(int ithr = -1);
private: private:
/** /**
@ -249,9 +255,11 @@ private:
/** /**
* Creates new tree and file for compression * Creates new tree and file for compression
* @param ithr thread number
* @param iframe frame number
*\returns OK for succces or FAIL for failure *\returns OK for succces or FAIL for failure
*/ */
int createCompressionFile(); int createCompressionFile(int ithr, int iframe);
/** /**
* Creates new file * Creates new file
@ -439,9 +447,6 @@ private:
/** to know if listening and writer threads created properly */ /** to know if listening and writer threads created properly */
int thread_started; int thread_started;
/** mask showing which threads are running */
volatile int32_t writerthreads_mask;
/** current writer thread index*/ /** current writer thread index*/
int currentWriterThreadIndex; int currentWriterThreadIndex;
@ -480,15 +485,6 @@ private:
pthread_mutex_t write_mutex; pthread_mutex_t write_mutex;
//filter
singlePhotonDetector<uint16_t> *singlePhotonDet;
moench02ModuleData *mdecoder;
bool commonModeSubtractionEnable;
int iFrame;
/** /**
callback arguments are callback arguments are
filepath filepath
@ -531,27 +527,32 @@ private:
* 2 we open, close, write file, callback does not do anything */ * 2 we open, close, write file, callback does not do anything */
int cbAction; int cbAction;
//filter
singlePhotonDetector<uint16_t> *singlePhotonDet[MAX_NUM_WRITER_THREADS];
moench02ModuleData *mdecoder[MAX_NUM_WRITER_THREADS];
bool commonModeSubtractionEnable;
public: public:
#ifdef MYROOT1 #ifdef MYROOT1
/** Tree where the hits are stored */ /** Tree where the hits are stored */
static TTree *myTree; TTree *myTree[MAX_NUM_WRITER_THREADS];
/** File where the tree is saved */ /** File where the tree is saved */
static TFile *myFile; TFile *myFile[MAX_NUM_WRITER_THREADS];
#endif #endif
/** File Descriptor */ /** File Descriptor */
static FILE *sfilefd; FILE *sfilefd;
/** if the receiver threads are running*/ /** mask showing which threads are running */
static int receiver_threads_running; volatile uint32_t writerthreads_mask;
/** 0 if receiver is idle, 1 otherwise */ /** 0 if listening thread is idle, 1 otherwise */
static int running; int listening_thread_running;
/** /**
callback arguments are callback arguments are