clean up state transitions
This commit is contained in:
@@ -148,7 +148,6 @@ void timer::privateCancel ( epicsGuard < epicsMutex > & locker )
|
||||
}
|
||||
else if ( this->curState == stateActive ) {
|
||||
this->queue.cancelPending = true;
|
||||
this->curState = timer::stateLimbo;
|
||||
if ( this->queue.processThread != epicsThreadGetIdSelf() ) {
|
||||
// make certain timer expire() does not run after cancel () returns,
|
||||
// but dont require that lock is applied while calling expire()
|
||||
@@ -158,15 +157,19 @@ void timer::privateCancel ( epicsGuard < epicsMutex > & locker )
|
||||
this->queue.pExpireTmr == this ) {
|
||||
this->queue.cancelBlockingEvent.wait ();
|
||||
}
|
||||
// in case other threads are waiting
|
||||
this->queue.cancelBlockingEvent.signal ();
|
||||
}
|
||||
// in case other threads are waiting
|
||||
this->queue.cancelBlockingEvent.signal ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
epicsTimer::expireInfo timer::getExpireInfo () const
|
||||
{
|
||||
// taking a lock here guarantees that users will not
|
||||
// see brief intervals when a timer isnt active because
|
||||
// it is is canceled when start is called
|
||||
epicsGuard < epicsMutex > locker ( this->queue.mutex );
|
||||
if ( this->curState == statePending || this->curState == stateActive ) {
|
||||
return expireInfo ( true, this->exp );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user