poll: k_poll: Return -EINTR if not ready

In case _handle_obj_poll_events is called with K_POLL_STATE_NOT_READY
set -EINTR as return to the poller thread.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2017-10-17 15:33:32 +03:00 committed by Anas Nashif
commit fc775a095c

View file

@ -292,7 +292,8 @@ static int _signal_poll_event(struct k_poll_event *event, u32_t state,
_unpend_thread(thread);
_abort_thread_timeout(thread);
_set_thread_return_value(thread, 0);
_set_thread_return_value(thread,
state == K_POLL_STATE_NOT_READY ? -EINTR : 0);
if (!_is_thread_ready(thread)) {
goto ready_event;