auto mutex release now requires an auto mutex
This commit is contained in:
@@ -68,7 +68,7 @@ void timer::start ( epicsTimerNotify & notify, double delaySeconds )
|
||||
void timer::start ( epicsTimerNotify & notify, const epicsTime & expire )
|
||||
{
|
||||
epicsAutoMutex locker ( this->queue.mutex );
|
||||
this->privateCancel ();
|
||||
this->privateCancel ( locker );
|
||||
this->privateStart ( notify, expire );
|
||||
}
|
||||
|
||||
@@ -127,10 +127,10 @@ void timer::privateStart ( epicsTimerNotify & notify, const epicsTime & expire )
|
||||
void timer::cancel ()
|
||||
{
|
||||
epicsAutoMutex locker ( this->queue.mutex );
|
||||
this->privateCancel ();
|
||||
this->privateCancel ( locker );
|
||||
}
|
||||
|
||||
void timer::privateCancel ()
|
||||
void timer::privateCancel ( epicsAutoMutex & locker )
|
||||
{
|
||||
while ( true ) {
|
||||
if ( this->curState == statePending ) {
|
||||
@@ -147,7 +147,7 @@ void timer::privateCancel ()
|
||||
// make certain timer expire() does not run after cancel () returns,
|
||||
// but dont require that lock is applied while calling expire()
|
||||
{
|
||||
epicsAutoMutexRelease autoRelease ( this->queue.mutex );
|
||||
epicsAutoMutexRelease autoRelease ( locker );
|
||||
while ( this->queue.cancelPending ) {
|
||||
this->queue.cancelBlockingEvent.wait ();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
epicsTimerNotify *pNotify; // callback
|
||||
timerQueue &queue;
|
||||
void privateStart ( epicsTimerNotify & notify, const epicsTime & );
|
||||
void privateCancel ();
|
||||
void privateCancel ( epicsAutoMutex & );
|
||||
timer & operator = ( const timer & );
|
||||
friend class timerQueue;
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ epicsTimerQueueActive &epicsTimerQueueActive::allocate ( bool okToShare, unsigne
|
||||
}
|
||||
|
||||
timerQueueActive::timerQueueActive ( bool okToShareIn, unsigned priority ) :
|
||||
queue ( *this ), thread ( *this, "epicsTimerQueueActive",
|
||||
queue ( *this ), thread ( *this, "timerQueue",
|
||||
epicsThreadGetStackSize ( epicsThreadStackMedium ), priority ),
|
||||
okToShare ( okToShareIn ), exitFlag ( false ), terminateFlag ( false )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user