Page 2 of 2

Re: why does chThdSleep() not allow a zero delay?

Posted: Fri Dec 13, 2013 5:20 am
by jafrey
I seem to be running into this right now:

Code: Select all

chThdSleepSeconds(0.0);
chThdSleepUntil(chTimeNow() + S2ST(0));


Should be near identical however chThdSleepSeconds doesn't accept 0 or decimal while chThdSleepUntil doesn't seem to have a problem with it. Is there a technical reason for why one would work but the other wouldn't?

Re: why does chThdSleep() not allow a zero delay?

Posted: Fri Dec 13, 2013 10:53 am
by Giovanni
Hi,

Zero is a reserved constant for intervals, the minimum is one. chThdSleepUntil() does not handle intervals but absolute times so zero is valid.

Giovanni