move sleep quantum cache to proper place in active timer queue
This commit is contained in:
@@ -66,7 +66,7 @@ void timer::start ( epicsTimerNotify & notify, const epicsTime & expire )
|
||||
void timer::privateStart ( epicsTimerNotify & notify, const epicsTime & expire )
|
||||
{
|
||||
this->pNotify = & notify;
|
||||
this->exp = expire - this->queue.sleepQuantumOverTwo;
|
||||
this->exp = expire - ( this->queue.notify.quantum () / 2.0 );
|
||||
|
||||
bool reschedualNeeded = false;
|
||||
if ( this->curState == stateActive ) {
|
||||
|
||||
@@ -100,7 +100,6 @@ private:
|
||||
mutable epicsMutex mutex;
|
||||
epicsEvent cancelBlockingEvent;
|
||||
tsDLList < timer > timerList;
|
||||
const double sleepQuantumOverTwo;
|
||||
epicsTimerQueueNotify & notify;
|
||||
timer * pExpireTmr;
|
||||
epicsThreadId processThread;
|
||||
@@ -138,6 +137,7 @@ private:
|
||||
epicsEvent rescheduleEvent;
|
||||
epicsEvent exitEvent;
|
||||
epicsThread thread;
|
||||
double sleepQuantum;
|
||||
bool okToShare;
|
||||
bool exitFlag;
|
||||
bool terminateFlag;
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
|
||||
epicsTimerQueue::~epicsTimerQueue () {}
|
||||
|
||||
timerQueue::timerQueue ( epicsTimerQueueNotify ¬ifyIn ) :
|
||||
sleepQuantumOverTwo ( notifyIn.quantum () / 2.0 ),
|
||||
timerQueue::timerQueue ( epicsTimerQueueNotify & notifyIn ) :
|
||||
notify ( notifyIn ), pExpireTmr ( 0 ),
|
||||
processThread ( 0 ), cancelPending ( false )
|
||||
{
|
||||
|
||||
@@ -43,7 +43,8 @@ epicsTimerQueueActive & epicsTimerQueueActive::allocate ( bool okToShare, unsign
|
||||
timerQueueActive::timerQueueActive ( bool okToShareIn, unsigned priority ) :
|
||||
queue ( *this ), thread ( *this, "timerQueue",
|
||||
epicsThreadGetStackSize ( epicsThreadStackMedium ), priority ),
|
||||
okToShare ( okToShareIn ), exitFlag ( false ), terminateFlag ( false )
|
||||
sleepQuantum ( epicsThreadSleepQuantum() ), okToShare ( okToShareIn ),
|
||||
exitFlag ( false ), terminateFlag ( false )
|
||||
{
|
||||
this->thread.start ();
|
||||
}
|
||||
@@ -88,7 +89,7 @@ void timerQueueActive::reschedule ()
|
||||
|
||||
double timerQueueActive::quantum ()
|
||||
{
|
||||
return epicsThreadSleepQuantum ();
|
||||
return this->sleepQuantum;
|
||||
}
|
||||
|
||||
void timerQueueActive::show ( unsigned int level ) const
|
||||
|
||||
Reference in New Issue
Block a user