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:
Benjamin Walsh 2016-09-29 11:03:51 -04:00
commit 7bc86c0344

View file

@ -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;
}