summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/workqueue.c14
-rw-r--r--lib/workqueue.h5
2 files changed, 4 insertions, 15 deletions
diff --git a/lib/workqueue.c b/lib/workqueue.c
index e87edef68b..d630af1d1d 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -281,8 +281,7 @@ void work_queue_run(struct event *thread)
do {
ret = wq->spec.workfunc(wq, item->data);
item->ran++;
- } while ((ret == WQ_RETRY_NOW)
- && (item->ran < wq->spec.max_retries));
+ } while (item->ran < wq->spec.max_retries);
switch (ret) {
case WQ_QUEUE_BLOCKED: {
@@ -292,9 +291,6 @@ void work_queue_run(struct event *thread)
item->ran--;
goto stats;
}
- case WQ_RETRY_LATER: {
- goto stats;
- }
case WQ_REQUEUE: {
item->ran--;
work_queue_item_requeue(wq, item);
@@ -312,11 +308,6 @@ void work_queue_run(struct event *thread)
titem = item;
break;
}
- case WQ_RETRY_NOW:
- /* a RETRY_NOW that gets here has exceeded max_tries, same
- * as ERROR
- */
- fallthrough;
case WQ_SUCCESS:
default: {
work_queue_item_remove(wq, item);
@@ -368,8 +359,7 @@ stats:
/* Is the queue done yet? If it is, call the completion callback. */
if (!work_queue_empty(wq)) {
- if (ret == WQ_RETRY_LATER ||
- ret == WQ_QUEUE_BLOCKED)
+ if (ret == WQ_QUEUE_BLOCKED)
work_queue_schedule(wq, wq->spec.retry);
else
work_queue_schedule(wq, 0);
diff --git a/lib/workqueue.h b/lib/workqueue.h
index 8b340ce532..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.. */
@@ -144,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