Revert "replace most internal getCurrent() -> getMonotonic()"

This reverts commit 4f2228fb1d
except for some test code.
This commit is contained in:
Michael Davidsaver
2020-04-24 15:37:48 -07:00
parent 85d1982890
commit f1cbe93b6c
15 changed files with 31 additions and 31 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ int CASG::block (
return ECA_TIMEOUT;
}
cur_time = epicsTime::getMonotonic ();
cur_time = epicsTime::getCurrent ();
this->client.flush ( guard );
@@ -121,7 +121,7 @@ int CASG::block (
/*
* force a time update
*/
cur_time = epicsTime::getMonotonic ();
cur_time = epicsTime::getCurrent ();
delay = cur_time - beg_time;
}
+4 -4
View File
@@ -475,7 +475,7 @@ int ca_client_context::pendIO ( const double & timeout )
}
int status = ECA_NORMAL;
epicsTime beg_time = epicsTime::getMonotonic ();
epicsTime beg_time = epicsTime::getCurrent ();
double remaining = timeout;
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -493,7 +493,7 @@ int ca_client_context::pendIO ( const double & timeout )
this->blockForEventAndEnableCallbacks ( this->ioDone, remaining );
}
double delay = epicsTime::getMonotonic () - beg_time;
double delay = epicsTime::getCurrent () - beg_time;
if ( delay < timeout ) {
remaining = timeout - delay;
}
@@ -522,7 +522,7 @@ int ca_client_context::pendEvent ( const double & timeout )
return ECA_EVDISALLOW;
}
epicsTime current = epicsTime::getMonotonic ();
epicsTime current = epicsTime::getCurrent ();
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -563,7 +563,7 @@ int ca_client_context::pendEvent ( const double & timeout )
this->noWakeupSincePend = true;
}
double elapsed = epicsTime::getMonotonic() - current;
double elapsed = epicsTime::getCurrent() - current;
double delay;
if ( timeout > elapsed ) {
+1 -1
View File
@@ -130,7 +130,7 @@ cac::cac (
epicsMutex & callbackControlIn,
cacContextNotify & notifyIn ) :
_refLocalHostName ( localHostNameCache.getReference () ),
programBeginTime ( epicsTime::getMonotonic() ),
programBeginTime ( epicsTime::getCurrent() ),
connTMO ( CA_CONN_VERIFY_PERIOD ),
mutex ( mutualExclusionIn ),
cbMutex ( callbackControlIn ),
+1 -1
View File
@@ -43,7 +43,7 @@ searchTimer::searchTimer (
const unsigned indexIn,
epicsMutex & mutexIn,
bool boostPossibleIn ) :
timeAtLastSend ( epicsTime::getMonotonic () ),
timeAtLastSend ( epicsTime::getCurrent () ),
timer ( queueIn.createTimer () ),
iiu ( iiuIn ),
mutex ( mutexIn ),
+2 -2
View File
@@ -476,7 +476,7 @@ void tcpRecvThread::run ()
statusWireIO stat;
pComBuf->fillFromWire ( this->iiu, stat );
epicsTime currentTime = epicsTime::getMonotonic ();
epicsTime currentTime = epicsTime::getCurrent ();
{
epicsGuard < epicsMutex > guard ( this->iiu.mutex );
@@ -1669,7 +1669,7 @@ bool tcpiiu::sendThreadFlush ( epicsGuard < epicsMutex > & guard )
if ( this->sendQue.occupiedBytes() > 0 ) {
while ( comBuf * pBuf = this->sendQue.popNextComBufToSend () ) {
epicsTime current = epicsTime::getMonotonic ();
epicsTime current = epicsTime::getCurrent ();
unsigned bytesToBeSent = pBuf->occupiedBytes ();
bool success = false;
+1 -1
View File
@@ -435,7 +435,7 @@ void udpRecvThread::run ()
}
else if ( status > 0 ) {
this->iiu.postMsg ( src, this->iiu.recvBuf,
(arrayElementCount) status, epicsTime::getMonotonic() );
(arrayElementCount) status, epicsTime::getCurrent() );
}
} while ( ! this->iiu.shutdownCmd );
@@ -144,12 +144,12 @@ void dbPutNotifyBlocker::initiatePutNotify (
break;
}
if ( beginTimeInit ) {
if ( epicsTime::getMonotonic () - begin > 30.0 ) {
if ( epicsTime::getCurrent () - begin > 30.0 ) {
throw cacChannel::requestTimedOut ();
}
}
else {
begin = epicsTime::getMonotonic ();
begin = epicsTime::getCurrent ();
beginTimeInit = true;
}
{
+3 -3
View File
@@ -97,7 +97,7 @@ epicsShareFunc void fdManager::process (double delay)
// more than once here so that fd activity get serviced
// in a reasonable length of time.
//
double minDelay = this->pTimerQueue->process(epicsTime::getMonotonic());
double minDelay = this->pTimerQueue->process(epicsTime::getCurrent());
if ( minDelay >= delay ) {
minDelay = delay;
@@ -121,7 +121,7 @@ epicsShareFunc void fdManager::process (double delay)
fd_set * pExceptSet = & this->fdSetsPtr[fdrException];
int status = select (this->maxFD, pReadSet, pWriteSet, pExceptSet, &tv);
this->pTimerQueue->process(epicsTime::getMonotonic());
this->pTimerQueue->process(epicsTime::getCurrent());
if ( status > 0 ) {
@@ -204,7 +204,7 @@ epicsShareFunc void fdManager::process (double delay)
* of select()
*/
epicsThreadSleep(minDelay);
this->pTimerQueue->process(epicsTime::getMonotonic());
this->pTimerQueue->process(epicsTime::getCurrent());
}
this->processInProg = false;
return;
+2 -2
View File
@@ -164,7 +164,7 @@ bool epicsThread::exitWait ( const double delay ) throw ()
}
return true;
}
epicsTime exitWaitBegin = epicsTime::getMonotonic ();
epicsTime exitWaitBegin = epicsTime::getCurrent ();
double exitWaitElapsed = 0.0;
epicsGuard < epicsMutex > guard ( this->mutex );
this->cancel = true;
@@ -172,7 +172,7 @@ bool epicsThread::exitWait ( const double delay ) throw ()
epicsGuardRelease < epicsMutex > unguard ( guard );
this->event.signal ();
this->exitEvent.wait ( delay - exitWaitElapsed );
epicsTime current = epicsTime::getMonotonic ();
epicsTime current = epicsTime::getCurrent ();
exitWaitElapsed = current - exitWaitBegin;
}
if(this->terminated && !joined) {
+1 -1
View File
@@ -173,7 +173,7 @@ extern "C" double epicsShareAPI
epicsTimerQueuePassiveProcess ( epicsTimerQueuePassiveId pQueue )
{
try {
return pQueue->process ( epicsTime::getMonotonic() );
return pQueue->process ( epicsTime::getCurrent() );
}
catch ( ... ) {
return 1.0;
+1 -1
View File
@@ -118,7 +118,7 @@ inline double epicsTimer::getExpireDelay ()
{
epicsTimer::expireInfo info = this->getExpireInfo ();
if ( info.active ) {
double delay = info.expireTime - epicsTime::getMonotonic ();
double delay = info.expireTime - epicsTime::getCurrent ();
if ( delay < 0.0 ) {
delay = 0.0;
}
+3 -3
View File
@@ -54,7 +54,7 @@ void timer::destroy ()
void timer::start ( epicsTimerNotify & notify, double delaySeconds )
{
this->start ( notify, epicsTime::getMonotonic () + delaySeconds );
this->start ( notify, epicsTime::getCurrent () + delaySeconds );
}
void timer::start ( epicsTimerNotify & notify, const epicsTime & expire )
@@ -129,7 +129,7 @@ void timer::privateStart ( epicsTimerNotify & notify, const epicsTime & expire )
debugPrintf ( ("Start of \"%s\" with delay %f at %p preempting %u\n",
typeid ( this->notify ).name (),
expire - epicsTime::getMonotonic (),
expire - epicsTime::getCurrent (),
this, preemptCount ) );
}
@@ -190,7 +190,7 @@ void timer::show ( unsigned int level ) const
double delay;
if ( this->curState == statePending || this->curState == stateActive ) {
try {
delay = this->exp - epicsTime::getMonotonic();
delay = this->exp - epicsTime::getCurrent();
}
catch ( ... ) {
delay = - DBL_MAX;
+2 -2
View File
@@ -30,7 +30,7 @@ timerQueue::timerQueue ( epicsTimerQueueNotify & notifyIn ) :
pExpireTmr ( 0 ),
processThread ( 0 ),
exceptMsgTimeStamp (
epicsTime :: getMonotonic () - exceptMsgMinPeriod ),
epicsTime :: getCurrent () - exceptMsgMinPeriod ),
cancelPending ( false )
{
}
@@ -49,7 +49,7 @@ void timerQueue ::
char date[64];
double delay;
try {
epicsTime cur = epicsTime :: getMonotonic ();
epicsTime cur = epicsTime :: getCurrent ();
delay = cur - this->exceptMsgTimeStamp;
cur.strftime ( date, sizeof ( date ),
"%a %b %d %Y %H:%M:%S.%f" );
@@ -73,7 +73,7 @@ void timerQueueActive :: _printLastChanceExceptionMessage (
{
char date[64];
try {
epicsTime cur = epicsTime :: getMonotonic ();
epicsTime cur = epicsTime :: getCurrent ();
cur.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f");
}
catch ( ... ) {
@@ -91,7 +91,7 @@ void timerQueueActive :: run ()
epics::atomic::set(this->exitFlag, 0);
while ( ! this->terminateFlag ) {
try {
double delay = this->queue.process ( epicsTime::getMonotonic() );
double delay = this->queue.process ( epicsTime::getCurrent() );
debugPrintf ( ( "timer thread sleeping for %g sec (max)\n", delay ) );
this->rescheduleEvent.wait ( delay );
}
+4 -4
View File
@@ -159,7 +159,7 @@ void testAccuracy ()
expireCount = nTimers;
for ( i = 0u; i < nTimers; i++ ) {
epicsTime cur = epicsTime::getMonotonic ();
epicsTime cur = epicsTime::getCurrent ();
pTimers[i]->setBegin ( cur );
pTimers[i]->start ( cur + pTimers[i]->delay () );
}
@@ -256,7 +256,7 @@ void testCancel ()
testDiag ( "cancelCount = %u", cancelVerify::cancelCount );
testDiag ( "starting %d timers", nTimers );
epicsTime exp = epicsTime::getMonotonic () + 4.0;
epicsTime exp = epicsTime::getCurrent () + 4.0;
for ( i = 0u; i < nTimers; i++ ) {
pTimers[i]->start ( exp );
}
@@ -342,7 +342,7 @@ void testExpireDestroy ()
testOk1 ( expireDestroyVerify::destroyCount == 0 );
testDiag ( "starting %d timers", nTimers );
epicsTime cur = epicsTime::getMonotonic ();
epicsTime cur = epicsTime::getCurrent ();
for ( i = 0u; i < nTimers; i++ ) {
pTimers[i]->start ( cur );
}
@@ -435,7 +435,7 @@ void testPeriodic ()
testOk1 ( timerCount == nTimers );
testDiag ( "starting %d timers", nTimers );
epicsTime cur = epicsTime::getMonotonic ();
epicsTime cur = epicsTime::getCurrent ();
for ( i = 0u; i < nTimers; i++ ) {
pTimers[i]->start ( cur );
}