MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _do_pop

Function _do_pop

components/vbus/prio_queue.c:38–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38static struct rt_prio_queue_item* _do_pop(struct rt_prio_queue *que)
39{
40 int ffs;
41 struct rt_prio_queue_item *item;
42
43 ffs = __rt_ffs(que->bitmap);
44 if (ffs == 0)
45 return RT_NULL;
46 ffs--;
47
48 item = que->head[ffs];
49 RT_ASSERT(item);
50
51 que->head[ffs] = item->next;
52 if (que->head[ffs] == RT_NULL)
53 {
54 que->bitmap &= ~(1 << ffs);
55 }
56
57 return item;
58}
59
60rt_err_t rt_prio_queue_init(struct rt_prio_queue *que,
61 const char *name,

Callers 1

rt_prio_queue_popFunction · 0.85

Calls 1

__rt_ffsFunction · 0.50

Tested by

no test coverage detected