You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 10, 2022. It is now read-only.
The header doc for nyoci_plat_wait() says "it returns 0 if nyoci_plat_process() should be executed". The POSIX implementation doesn't quite agree with this: it does return 0 if a file descriptor has input, but it returns NYOCI_STATUS_TIMEOUT if a timer is ready to fire. Thus, a loop like this one won't work because it never handles timers until a packet arrives:
while (true) {
if (nyoci_plat_wait(_nyoci, MSEC_PER_SEC) ==0)
nyoci_plat_process(_nyoci);
}
This happens because the function doesn't distinguish whether it's the timeout given by the caller that's elapsed, or the timeout till the next timer. In the latter case it should return 0.
Alternatively, the docs could be amended to match the implementation, by saying that if the function returns NYOCI_STATUS_TIMEOUT, then nyoci_handle_timers() should be called.
The header doc for
nyoci_plat_wait()says "it returns 0 if nyoci_plat_process() should be executed". The POSIX implementation doesn't quite agree with this: it does return 0 if a file descriptor has input, but it returnsNYOCI_STATUS_TIMEOUTif a timer is ready to fire. Thus, a loop like this one won't work because it never handles timers until a packet arrives:This happens because the function doesn't distinguish whether it's the timeout given by the caller that's elapsed, or the timeout till the next timer. In the latter case it should return 0.
Alternatively, the docs could be amended to match the implementation, by saying that if the function returns
NYOCI_STATUS_TIMEOUT, thennyoci_handle_timers()should be called.