forked from Mirror/frr
lib: Move workqueue private functions into workqueue.c
Some Functions are not used outside of workqueue.c. Move them inside of workqueue.c to limit scope. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
a22ab3f98f
commit
a553bd6d68
|
@ -42,6 +42,15 @@ static void work_queue_item_free(struct work_queue_item *item)
|
|||
return;
|
||||
}
|
||||
|
||||
static inline void work_queue_item_dequeue(struct work_queue *wq,
|
||||
struct work_queue_item *item)
|
||||
{
|
||||
assert(wq->item_count > 0);
|
||||
|
||||
wq->item_count--;
|
||||
STAILQ_REMOVE(&wq->items, item, work_queue_item, wq);
|
||||
}
|
||||
|
||||
static void work_queue_item_remove(struct work_queue *wq,
|
||||
struct work_queue_item *item)
|
||||
{
|
||||
|
@ -133,6 +142,13 @@ static int work_queue_schedule(struct work_queue *wq, unsigned int delay)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void work_queue_item_enqueue(struct work_queue *wq,
|
||||
struct work_queue_item *item)
|
||||
{
|
||||
STAILQ_INSERT_TAIL(&wq->items, item, wq);
|
||||
wq->item_count++;
|
||||
}
|
||||
|
||||
void work_queue_add(struct work_queue *wq, void *data)
|
||||
{
|
||||
struct work_queue_item *item;
|
||||
|
|
|
@ -117,22 +117,6 @@ work_queue_last_item(struct work_queue *wq)
|
|||
return STAILQ_LAST(&wq->items, work_queue_item, wq);
|
||||
}
|
||||
|
||||
static inline void work_queue_item_enqueue(struct work_queue *wq,
|
||||
struct work_queue_item *item)
|
||||
{
|
||||
STAILQ_INSERT_TAIL(&wq->items, item, wq);
|
||||
wq->item_count++;
|
||||
}
|
||||
|
||||
static inline void work_queue_item_dequeue(struct work_queue *wq,
|
||||
struct work_queue_item *item)
|
||||
{
|
||||
assert(wq->item_count > 0);
|
||||
|
||||
wq->item_count--;
|
||||
STAILQ_REMOVE(&wq->items, item, work_queue_item, wq);
|
||||
}
|
||||
|
||||
/* create a new work queue, of given name.
|
||||
* user must fill in the spec of the returned work queue before adding
|
||||
* anything to it
|
||||
|
|
Loading…
Reference in a new issue