Lines Matching full:item
19 static void set_prio(struct k_thread *th, struct k_p4wq_work *item) in set_prio() argument
22 th->base.prio = item->priority; in set_prio()
23 th->base.prio_deadline = item->deadline; in set_prio()
116 /* Must be called to regain ownership of the work item */
215 void k_p4wq_submit(struct k_p4wq *queue, struct k_p4wq_work *item) in k_p4wq_submit() argument
223 item->deadline += k_cycle_get_32(); in k_p4wq_submit()
226 if (item->thread == arch_current_thread()) { in k_p4wq_submit()
227 sys_dlist_remove(&item->dlnode); in k_p4wq_submit()
229 item->thread = NULL; in k_p4wq_submit()
231 k_sem_init(&item->done_sem, 0, 1); in k_p4wq_submit()
233 __ASSERT_NO_MSG(item->thread == NULL); in k_p4wq_submit()
235 rb_insert(&queue->queue, &item->rbnode); in k_p4wq_submit()
236 item->queue = queue; in k_p4wq_submit()
242 if (rb_get_max(&queue->queue) != &item->rbnode) { in k_p4wq_submit()
248 * higher priority than the new item, then no one needs to be in k_p4wq_submit()
260 if (!item_lessthan(wi, item)) { in k_p4wq_submit()
282 set_prio(th, item); in k_p4wq_submit()
292 bool k_p4wq_cancel(struct k_p4wq *queue, struct k_p4wq_work *item) in k_p4wq_cancel() argument
295 bool ret = rb_contains(&queue->queue, &item->rbnode); in k_p4wq_cancel()
298 rb_remove(&queue->queue, &item->rbnode); in k_p4wq_cancel()
299 k_sem_give(&item->done_sem); in k_p4wq_cancel()