Comment 26 for bug 1861612

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

@Ben, The short answer is the both Andrew and I have tried +=1 and it doesn't work.

I think I can explain the reason by referring to the Timing diagram (delay.png) I've attached to this issue.

Consider a case where D (requested timeout) is slightly less than T (tick period), and A (time from call to next tick) is almost zero.

In this case the float to int conversion floor(D/T)==0. So +=1 gives a delay of 1. This will wait until the next tick (time A) which is almost zero.

The primitives we're working with on RTEMS and vxWorks seem to respond to a requested non-zero timeout of 'd' ticks by waiting A+T*(d-1) seconds.