move sleep quantum cache to proper place in active timer queue

This commit is contained in:
Jeff Hill
2003-03-26 22:12:07 +00:00
parent 7b589b0e27
commit d0f68ee85f
4 changed files with 6 additions and 6 deletions

View File

@@ -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 ) {

View File

@@ -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;

View File

@@ -21,8 +21,7 @@
epicsTimerQueue::~epicsTimerQueue () {}
timerQueue::timerQueue ( epicsTimerQueueNotify &notifyIn ) :
sleepQuantumOverTwo ( notifyIn.quantum () / 2.0 ),
timerQueue::timerQueue ( epicsTimerQueueNotify & notifyIn ) :
notify ( notifyIn ), pExpireTmr ( 0 ),
processThread ( 0 ), cancelPending ( false )
{

View File

@@ -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