if delay>0 than taswkDelay at least 1 tick

This commit is contained in:
Marty Kraimer
2001-05-18 18:11:42 +00:00
parent 4dc395bb24
commit f30ceae58b

View File

@@ -234,8 +234,15 @@ int epicsThreadIsSuspended(epicsThreadId id)
void epicsThreadSleep(double seconds)
{
STATUS status;
int ticks;
status = taskDelay((int)(seconds*sysClkRateGet()));
if(seconds<=0.0) {
ticks = 0;
} else {
ticks = seconds*sysClkRateGet();
if(ticks<=0) ticks = 1;
}
status = taskDelay(ticks);
if(status) errlogPrintf(0,"epicsThreadSleep\n");
}