kernel/poll: add missing poll_event runtime init

It was in the static initializers, but was missing from the object
runtime init functions.

Change-Id: I10d519760eabdbe640a19cc5cfa9241c1356b070
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
This commit is contained in:
Benjamin Walsh 2017-02-02 16:39:57 -05:00 committed by Anas Nashif
commit b017986347
3 changed files with 11 additions and 0 deletions

View file

@ -3104,6 +3104,12 @@ extern void k_free(void *ptr);
/* polling API - PRIVATE */
#ifdef CONFIG_POLL
#define _INIT_OBJ_POLL_EVENT(obj) do { (obj)->poll_event = NULL; } while ((0))
#else
#define _INIT_OBJ_POLL_EVENT(obj) do { } while ((0))
#endif
/* private - implementation data created as needed, per-type */
struct _poller {
struct k_thread *thread;

View file

@ -52,6 +52,8 @@ void k_fifo_init(struct k_fifo *fifo)
sys_slist_init(&fifo->data_q);
sys_dlist_init(&fifo->wait_q);
_INIT_OBJ_POLL_EVENT(fifo);
SYS_TRACING_OBJ_INIT(k_fifo, fifo);
}

View file

@ -73,6 +73,9 @@ void k_sem_init(struct k_sem *sem, unsigned int initial_count,
sem->count = initial_count;
sem->limit = limit;
sys_dlist_init(&sem->wait_q);
_INIT_OBJ_POLL_EVENT(sem);
SYS_TRACING_OBJ_INIT(k_sem, sem);
}