summaryrefslogtreecommitdiffstats
path: root/lib/workqueue.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2018-12-11 20:56:08 +0100
committerMark Stapp <mjs@voltanet.io>2018-12-13 20:08:39 +0100
commit5418f988cf2e31be9fd79489319ff0f9e05091be (patch)
tree690d7bc28456bc92b79941532d7c6e2e54729eeb /lib/workqueue.h
parenttopotests: Add a basic route leak vrf test (diff)
downloadfrr-5418f988cf2e31be9fd79489319ff0f9e05091be.tar.xz
frr-5418f988cf2e31be9fd79489319ff0f9e05091be.zip
libs: support timeout for workqueue retries
Support an optional timeout/delay for use when a workqueue determines that it is blocked, instead of retrying immediately. Also, schedule as an 'event' instead of a 'timer' when using a zero timeout value. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/workqueue.h')
-rw-r--r--lib/workqueue.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/workqueue.h b/lib/workqueue.h
index fe1700f8d..7c8465506 100644
--- a/lib/workqueue.h
+++ b/lib/workqueue.h
@@ -30,6 +30,9 @@ DECLARE_MTYPE(WORK_QUEUE)
/* Hold time for the initial schedule of a queue run, in millisec */
#define WORK_QUEUE_DEFAULT_HOLD 50
+/* Retry for queue that is 'blocked' or 'retry later' */
+#define WORK_QUEUE_DEFAULT_RETRY 0
+
/* action value, for use by item processor and item error handlers */
typedef enum {
WQ_SUCCESS = 0,
@@ -90,6 +93,8 @@ struct work_queue {
unsigned long
yield; /* yield time in us for associated thread */
+
+ uint32_t retry; /* Optional retry timeout if queue is blocked */
} spec;
/* remaining fields should be opaque to users */