zephyr/kernel
Paul Sokolovsky 3f50707672 kernel: queue, fifo: Add cancel_wait operation.
Currently, a queue/fifo getter chooses how long to wait for an
element. But there are scenarios when putter would know better,
there should be a way to expire getter's timeout to make it run
again. k_queue_cancel_wait() and k_fifo_cancel_wait() functions
do just that. They cause corresponding *_get() functions to return
with NULL value, as if timeout expired on getter's side (even
K_FOREVER).

This can be used to signal out of band conditions from putter to
getter, e.g. end of processing, error, configuration change, etc.
A specific event would be communicated to getter by other means
(e.g. using existing shared context structures).

Without this call, achieving the same effect would require e.g.
calling k_fifo_put() with a pointer to a special sentinal memory
structure - such structure would need to be allocated somewhere
and somehow, and getter would need to recognize it from a normal
data item. Having cancel_wait() functions offers an elegant
alternative. From this perspective, these calls can be seen as
an equivalent to e.g. k_fifo_put(fifo, NULL), except that such
call won't work in practice.

Change-Id: I47b7f690dc325a80943082bcf5345c41649e7024
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-10 09:40:33 -04:00
..
configs kernel: add LEGACY_KERNEL option 2017-01-09 19:42:13 +00:00
include kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
alert.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
atomic_c.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
compiler_stack_protect.c kernel: add k_panic() and k_oops() APIs 2017-04-22 10:31:49 -04:00
device.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
errno.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
idle.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
init.c test: benchmarking: Timing metrics for the kernel 2017-05-03 08:46:30 -04:00
int_latency_bench.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
Kconfig test: benchmarking: Timing metrics for the kernel 2017-05-03 08:46:30 -04:00
Kconfig.event_logger kernel: Add thread events to kernel event logger 2017-04-25 02:16:36 +00:00
Kconfig.power_mgmt doc: misspellings in Kconfig files 2017-05-05 19:38:53 -04:00
mailbox.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
Makefile kernel: remove legacy kernel support 2017-04-19 15:48:37 +00:00
mem_pool.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
mem_slab.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
msg_q.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
mutex.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
pipes.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
poll.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
queue.c kernel: queue, fifo: Add cancel_wait operation. 2017-05-10 09:40:33 -04:00
sched.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
sem.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
stack.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sys_clock.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
system_work_q.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
thread_abort.c kernel: remove legacy kernel support 2017-04-19 15:48:37 +00:00
thread.c kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
timer.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
version.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
work_q.c Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00