From: <ro...@us...> - 2011-04-13 13:35:39
|
Revision: 2474 http://nscldaq.svn.sourceforge.net/nscldaq/?rev=2474&view=rev Author: ron-fox Date: 2011-04-13 13:35:29 +0000 (Wed, 13 Apr 2011) Log Message: ----------- Try to make end run more responsive. Modified Paths: -------------- branches/daqclients-8_2/clients/ProductionReadout/CExperiment.cpp Modified: branches/daqclients-8_2/clients/ProductionReadout/CExperiment.cpp =================================================================== --- branches/daqclients-8_2/clients/ProductionReadout/CExperiment.cpp 2011-04-13 12:22:24 UTC (rev 2473) +++ branches/daqclients-8_2/clients/ProductionReadout/CExperiment.cpp 2011-04-13 13:35:29 UTC (rev 2474) @@ -171,6 +171,7 @@ // DAQThreadId id( m_Id); m_Exiting = true; + __sync_synchronize(); // Gcc 4.x specific full memory barrier. // We have the mutex, we need to release it so the triger thread // can get it to run... we'll re-acquire after the join at the same level. @@ -308,11 +309,13 @@ dwell = 0; do { int triggers=0; - for(int i = 0; i < 500; i++) { + for(int i = 0; (i < 500) && (!m_Exiting); i++) { // Lower latency for exit. if((*m_pTrigger)()) { // Read an event... m_pExperiment->ReadEvent(); break; // Check elapsed time. } + __sync_synchronize(); // Gcc specific memory barrier + } // Now try the scaler trigger: @@ -330,11 +333,14 @@ // mutexend.tv_usec += SECOND*secdif; // dwell = (mutexend.tv_usec - mutexstart.tv_usec)/MILISECOND; dwell++; - } while(dwell < m_msHoldTime); + __sync_synchronize(); // Gcc specific memory barrier + } while((dwell < m_msHoldTime) && (!m_Exiting)); // Lowest possible exit latency. CApplicationSerializer::getInstance()->UnLock(); sched_yield(); + __sync_synchronize(); // Gcc specific memory barrier + } CApplicationSerializer::getInstance()->Lock(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |