zephyr/kernel
Paul Sokolovsky 45c0b20470 kernel: k_poll: Introduce separate status for cancelled events
Previously (as introduced in 48fadfe62), if k_poll() waited on a
queue (or subclass like fifo), and wait was cancelled on queue's
side using k_queue_cancel_wait(), k_poll returned -EINTR. But it
did not set event->state field (to anything else but
K_POLL_STATE_NOT_READY), so in case of waiting on multiple queues,
it was not possible to differentiate which of them was cancelled.

This in particular broke detection of network socket EOF conditions
in POSIX poll() implementation.

This situation is now resolved with introduction of explicit
K_POLL_STATE_CANCELLED state, which is now set for cancelled queue
(-EINTR return remains the same).

This change also elaborates docstring for the functions mentioned, to
document this behavior.

Fixes: #9032

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-30 09:28:29 -04:00
..
include sched: Properly account for timeslicing in tickless mode 2018-08-29 10:01:41 -04:00
alert.c syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
atomic_c.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
CMakeLists.txt kernel: Cmake: Add __ZEPHYR_SUPERVISOR__ macro for kernel files. 2018-05-15 17:48:18 +03:00
compiler_stack_protect.c kernel: add CODE_UNREACHABLE in _StackCheckHandler 2018-04-17 10:50:12 -07:00
device.c kernel: device: Only compare strings if pointer comparison fails 2018-02-15 17:31:59 -08:00
errno.c kernel: userspace: reserve stack space to store local data 2018-08-17 09:40:52 -07:00
idle.c kernel: idle: Define _sys_soc_resume functions conditionally 2018-07-19 17:12:58 -04:00
init.c kernel: Enable interrupts for MULTITHREADING=n on supported arch's 2018-08-27 16:15:10 -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 kernel: event_logger: remove kernel_event_logger 2018-08-21 05:45:47 -07:00
Kconfig.power_mgmt doc: fix kconfig misspellings 2018-08-28 13:58:46 -04:00
mailbox.c kernel: Explicitly ignoring memcpy return 2018-08-16 19:47:41 -07:00
mem_domain.c kernel: mem_domain: Fix compile issues 2018-03-05 10:47:00 -06:00
mem_slab.c kernel: mem_slab: Reschedule in k_mem_slab_free only when necessary. 2018-05-18 20:16:50 +03:00
mempool.c kernel: Explicitly ignoring memcpy return 2018-08-16 19:47:41 -07:00
msg_q.c kernel: Explicitly ignoring memcpy return 2018-08-16 19:47:41 -07:00
mutex.c tracing: support generic tracing hooks 2018-08-21 05:45:47 -07:00
pipes.c kernel: pipes: fix k_pipe_block_put() when not enough space 2018-08-29 15:57:28 -04:00
poll.c kernel: k_poll: Introduce separate status for cancelled events 2018-08-30 09:28:29 -04:00
queue.c kernel: k_poll: Introduce separate status for cancelled events 2018-08-30 09:28:29 -04:00
sched.c sched: Properly account for timeslicing in tickless mode 2018-08-29 10:01:41 -04:00
sem.c tracing: support generic tracing hooks 2018-08-21 05:45:47 -07:00
smp.c irq: Fix irq_lock api usage 2018-08-16 19:47:41 -07:00
stack.c kernel: Wait queues aren't dlists anymore 2018-05-19 07:00:55 +03:00
sys_clock.c kernel: Remove unused variable 2018-08-26 19:39:52 -07:00
system_work_q.c kernel: introduce stack definition macros 2017-06-09 18:53:28 -04:00
thread_abort.c syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
thread.c kernel: event_logger: remove kernel_event_logger 2018-08-21 05:45:47 -07:00
timer.c irq: Fix irq_lock api usage 2018-08-16 19:47:41 -07:00
userspace_handler.c syscalls: remove policy from handler checks 2018-05-17 23:34:03 +03:00
userspace.c kernel: Explicitly ignoring memcpy return 2018-08-16 19:47:41 -07:00
version.c kernel: version: no need to store version in RAM 2017-09-07 16:34:50 -07:00
work_q.c irq: Fix irq_lock api usage 2018-08-16 19:47:41 -07:00