Re: K_NO_WAIT, K_FOREVER and kernel APIs

Luiz Augusto von Dentz

Hi Carles,

On Mon, Aug 21, 2017 at 2:28 PM, Cufi, Carles <Carles.Cufi@...> wrote:
Hi all,

We've had 2 different issues recently coming from the fact that K_NO_WAIT and K_FOREVER do not seem to work with all of the kernel APIs. They are the following:

1) Calling k_timer_start() with K_NO_WAIT, meaning that one desires the timer callback function to be executed as soon as possible. This is useful when one wants to synchronize execution context and start a cyclic timer from the same callback code.
I though k_timer wouldn't be that useful after k_work/k_delayed_work
was introduced, especially given its blocking nature it usually much
easier to just use the system work queue, though that shall not be

2) Calling k_sleep() with K_FOREVER as a parameter. This looks reasonable to the developer since it simplifies the typical idling loop that one finds in Zephyr using k_cpu_idle(). Instead the kernel returns immediately, which is unexpected.
And would be awaken by k_wakeup?

I think that, due to the fact that both of those issues have confused our kernel API consumers already, we could consider making K_NO_WAIT and K_FOREVER compatible with all of the kernel APIs.



Zephyr-devel mailing list

Luiz Augusto von Dentz

Join to automatically receive all group messages.