summaryrefslogtreecommitdiff
path: root/lib/workqueue.h
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-11-04 13:58:55 +0200
committerGitHub <noreply@github.com>2023-11-04 13:58:55 +0200
commit4bdba57861d1325b42b5b81c118bf76b51f172e5 (patch)
tree97e9ebbdb2ea7e809915b173a15bbeb7a2625e6b /lib/workqueue.h
parentd4c596d77f34ac613a8c2be54a819f08df01feeb (diff)
parent2a65f05d77f88f96d4385040d01492e805e1cc44 (diff)
Merge pull request #14724 from donaldsharp/workqueue_cleanup
Workqueue cleanup
Diffstat (limited to 'lib/workqueue.h')
-rw-r--r--lib/workqueue.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/workqueue.h b/lib/workqueue.h
index 5d84739d5c..a495fe8615 100644
--- a/lib/workqueue.h
+++ b/lib/workqueue.h
@@ -26,9 +26,7 @@ DECLARE_MTYPE(WORK_QUEUE);
/* action value, for use by item processor and item error handlers */
typedef enum {
WQ_SUCCESS = 0,
- WQ_RETRY_NOW, /* retry immediately */
- WQ_RETRY_LATER, /* retry later, cease processing work queue */
- WQ_REQUEUE, /* requeue item, continue processing work queue */
+ WQ_REQUEUE, /* requeue item, continue processing work queue */
WQ_QUEUE_BLOCKED, /* Queue cant be processed at this time.
* Similar to WQ_RETRY_LATER, but doesn't penalise
* the particular item.. */
@@ -117,22 +115,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
@@ -160,6 +142,7 @@ bool work_queue_is_scheduled(struct work_queue *wq);
/* Helpers, exported for thread.c and command.c */
extern void work_queue_run(struct event *thread);
+/* Function to initialize the workqueue cli */
extern void workqueue_cmd_init(void);
#ifdef __cplusplus