#include "mfacq.h" //--------------------------------------------------------------- // Programme d'acquisition BAORadio multi-fibres/multi-threads // LAL - 2009 - 2010 // R. Ansari, M.Taurigna //--------------------------------------------------------------- static RAcqMemZoneMgr* pMmgr=NULL; static PCIEMultiReader* pPcierThr=NULL; void Stop(int s) { if (s == 9765) cout << " Stop after exception ..." << endl; else printf("............. MAIN ... receive signal %d \n",s); if (pMmgr != NULL) pMmgr->Stop(); if (pPcierThr !=NULL) pPcierThr->Stop(); } //----------------------------------------------------------------------- //-------------------- le programme principal --------------------------- //----------------------------------------------------------------------- int main(int narg, char* arg[]) { int rc = 0; cout << " ============= BAORadio / Acquisition : mfacq =================" << endl; cout << " ===============================================================" << endl; cout << " ========= " < vec_pciw; for (int i=0 ;i0) { // On ne demarre que si au moins NMaxProc>0 PrThr.start(); } // On attend avant de declencher la terminaison des threads usleep(100000); cout << "mfacq[5] - Waiting for threads to finish ... " << endl; PcierThr.join(); DsThr.join(); mmgr.Stop(); if (acpar.NMaxProc>0) { // On ne demarre que si au moins NMaxProc>0 PrThr.join(); } pMmgr=NULL; cout << "mfacq[6] ---------- threads finished ---------------- " << endl; tm.Split("Threads Finished"); #ifndef NOPCIECARD for (int i=0 ;i