Merge remote-tracking branch 'lp-Com/use-monotonic' into 7.0

* lp-Com/use-monotonic:
  VxWorks: Measure CPU time-base frequency if necessary
  replace most internal getCurrent() -> getMonotonic()
  dbScan periodic scan use monotonic time
  monotonic adapt to regular time APIs
This commit is contained in:
Michael Davidsaver
2019-10-06 20:10:20 -07:00
26 changed files with 114 additions and 73 deletions

View File

@@ -83,7 +83,7 @@ int CASG::block (
return ECA_TIMEOUT;
}
cur_time = epicsTime::getCurrent ();
cur_time = epicsTime::getMonotonic ();
this->client.flush ( guard );
@@ -121,7 +121,7 @@ int CASG::block (
/*
* force a time update
*/
cur_time = epicsTime::getCurrent ();
cur_time = epicsTime::getMonotonic ();
delay = cur_time - beg_time;
}

View File

@@ -475,7 +475,7 @@ int ca_client_context::pendIO ( const double & timeout )
}
int status = ECA_NORMAL;
epicsTime beg_time = epicsTime::getCurrent ();
epicsTime beg_time = epicsTime::getMonotonic ();
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::getCurrent () - beg_time;
double delay = epicsTime::getMonotonic () - 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::getCurrent ();
epicsTime current = epicsTime::getMonotonic ();
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -563,7 +563,7 @@ int ca_client_context::pendEvent ( const double & timeout )
this->noWakeupSincePend = true;
}
double elapsed = epicsTime::getCurrent() - current;
double elapsed = epicsTime::getMonotonic() - current;
double delay;
if ( timeout > elapsed ) {

View File

@@ -130,7 +130,7 @@ cac::cac (
epicsMutex & callbackControlIn,
cacContextNotify & notifyIn ) :
_refLocalHostName ( localHostNameCache.getReference () ),
programBeginTime ( epicsTime::getCurrent() ),
programBeginTime ( epicsTime::getMonotonic() ),
connTMO ( CA_CONN_VERIFY_PERIOD ),
mutex ( mutualExclusionIn ),
cbMutex ( callbackControlIn ),

View File

@@ -59,7 +59,7 @@ int main ( int argc, char ** argv )
epicsMutex mutex;
epicsGuard < epicsMutex > guard ( mutex );
bheFreeStoreMgr bheFreeList;
epicsTime programBeginTime = epicsTime::getCurrent ();
epicsTime programBeginTime = epicsTime::getMonotonic ();
bool validCommandLine = false;
unsigned interest = 0u;
SOCKET sock;
@@ -244,7 +244,7 @@ int main ( int argc, char ** argv )
ca_uint32_t beaconNumber = ntohl ( pCurMsg->m_cid );
unsigned protocolRevision = ntohs ( pCurMsg->m_dataType );
epicsTime currentTime = epicsTime::getCurrent();
epicsTime currentTime = epicsTime::getMonotonic();
/*
* look for it in the hash table

View File

@@ -43,7 +43,7 @@ searchTimer::searchTimer (
const unsigned indexIn,
epicsMutex & mutexIn,
bool boostPossibleIn ) :
timeAtLastSend ( epicsTime::getCurrent () ),
timeAtLastSend ( epicsTime::getMonotonic () ),
timer ( queueIn.createTimer () ),
iiu ( iiuIn ),
mutex ( mutexIn ),

View File

@@ -476,7 +476,7 @@ void tcpRecvThread::run ()
statusWireIO stat;
pComBuf->fillFromWire ( this->iiu, stat );
epicsTime currentTime = epicsTime::getCurrent ();
epicsTime currentTime = epicsTime::getMonotonic ();
{
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::getCurrent ();
epicsTime current = epicsTime::getMonotonic ();
unsigned bytesToBeSent = pBuf->occupiedBytes ();
bool success = false;

View File

@@ -435,7 +435,7 @@ void udpRecvThread::run ()
}
else if ( status > 0 ) {
this->iiu.postMsg ( src, this->iiu.recvBuf,
(arrayElementCount) status, epicsTime::getCurrent() );
(arrayElementCount) status, epicsTime::getMonotonic() );
}
} while ( ! this->iiu.shutdownCmd );