ErGetTicks now locks while updating ticks

This commit is contained in:
Marty Kraimer
1999-07-07 19:54:46 +00:00
parent 772d6e199a
commit f0a195ee7d
2 changed files with 6 additions and 0 deletions

View File

@@ -219,13 +219,16 @@ long ErRegisterErrorHandler(int Card, ERROR_FUNC func)
******************************************************************************/
long ErGetTicks(int Card, unsigned long *Ticks)
{
int key;
if (ErHaveReceiver(Card) < 0)
return(-1);
/* BUG -- Do we read the HI first or the low? */
key = intLock();
*Ticks = ErLink[Card].pEr->EventCounterLo;
*Ticks += ErLink[Card].pEr->EventCounterHi << 16;
intUnlock(key);
return(0);
}

View File

@@ -219,13 +219,16 @@ long ErRegisterErrorHandler(int Card, ERROR_FUNC func)
******************************************************************************/
long ErGetTicks(int Card, unsigned long *Ticks)
{
int key;
if (ErHaveReceiver(Card) < 0)
return(-1);
/* BUG -- Do we read the HI first or the low? */
key = intLock();
*Ticks = ErLink[Card].pEr->EventCounterLo;
*Ticks += ErLink[Card].pEr->EventCounterHi << 16;
intUnlock(key);
return(0);
}