added new activate methods

This commit is contained in:
Jeff Hill
2000-06-16 23:36:37 +00:00
parent 2e67127f25
commit 8fa9db48ad
2 changed files with 47 additions and 0 deletions
+37
View File
@@ -196,6 +196,43 @@ void osiTimer::reschedule (double newDelay)
this->queue.timerLists[this->curState].remove (*this);
this->curState = stateLimbo;
this->arm (newDelay);
this->queue.mutex.unlock ();
}
//
// Start the timer with delay this->delay() if inactive
//
epicsShareFunc void osiTimer::activate ()
{
this->activate ( this->delay () );
}
//
// Start the timer with delay newDelay if inactive
//
epicsShareFunc void osiTimer::activate ( double newDelay )
{
if ( this->curState == stateLimbo ) {
return; // queue was destroyed
}
this->queue.mutex.lock ();
if ( this->curState == stateIdle ) {
//
// signal the timer queue if this
// occurring during the expire call
// back
//
if ( this == this->queue.pExpireTmr ) {
this->queue.pExpireTmr = 0;
}
this->queue.timerLists[this->curState].remove (*this);
this->curState = stateLimbo;
this->arm (newDelay);
}
this->queue.mutex.unlock ();
}
+10
View File
@@ -75,6 +75,16 @@ public:
*/
epicsShareFunc void reschedule ();
/*
* Start the timer with delay newDelay if inactive.
*/
epicsShareFunc void activate ( double newDelay );
/*
* Start the timer with delay this->delay() if inactive.
*/
epicsShareFunc void activate ();
/*
* inactivate the timer and call the virtual destroy()
* member function