unified: use sys_dlist_peek_head_not_empty()
When fetching the next thread to run, we know at least one thread is available. Change-Id: I568c33a61b6a0a6d6a7f79c337caecffd5ef70b6 Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
71d5228ca9
commit
7bc86c0344
1 changed files with 5 additions and 2 deletions
|
@ -149,11 +149,14 @@ struct tcs *_get_next_ready_thread(void)
|
|||
int prio = _get_highest_ready_prio();
|
||||
int q_index = _get_ready_q_q_index(prio);
|
||||
sys_dlist_t *list = &_nanokernel.ready_q.q[q_index];
|
||||
struct k_thread *thread = (struct k_thread *)sys_dlist_peek_head(list);
|
||||
|
||||
__ASSERT(thread, "no thread to run (prio: %d, queue index: %u)!\n",
|
||||
__ASSERT(!sys_dlist_is_empty(list),
|
||||
"no thread to run (prio: %d, queue index: %u)!\n",
|
||||
prio, q_index);
|
||||
|
||||
struct k_thread *thread =
|
||||
(struct k_thread *)sys_dlist_peek_head_not_empty(list);
|
||||
|
||||
return thread;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue