kernel: Fix sloppy wait queue API
There were multiple spots where code was using the _wait_q_t abstraction as a synonym for a dlist and doing direct list management on them with the dlist APIs. Refactor _wait_q_t into a proper opaque struct (not a typedef for sys_dlist_t) and write a simple wrapper API for the existing usages. Now replacement of wait_q with a different data structure is much cleaner. Note that there were some SYS_DLIST_FOR_EACH_SAFE loops in mailbox.c that got replaced by the normal/non-safe macro. While these loops do mutate the list in the code body, they always do an early return in those circumstances instead of returning into the macro'd for() loop, so the _SAFE usage was needless. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
4ca0e07088
commit
ccf3bf7ed3
18 changed files with 71 additions and 56 deletions
|
@ -43,7 +43,7 @@ void _pend_thread(struct k_thread *thread, _wait_q_t *wait_q, s32_t timeout);
|
|||
int _reschedule(int key);
|
||||
struct k_thread *_unpend_first_thread(_wait_q_t *wait_q);
|
||||
void _unpend_thread(struct k_thread *thread);
|
||||
void _unpend_all(_wait_q_t *wait_q);
|
||||
int _unpend_all(_wait_q_t *wait_q);
|
||||
void _thread_priority_set(struct k_thread *thread, int prio);
|
||||
void *_get_next_switch_handle(void *interrupted);
|
||||
struct k_thread *_find_first_thread_to_unpend(_wait_q_t *wait_q,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue