summaryrefslogtreecommitdiffstats
path: root/lib/seqlock.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-06-19 12:52:38 +0200
committerDavid Lamparter <equinox@diac24.net>2019-07-31 03:33:41 +0200
commit2a5e62359f737b233a8b06731ce60f915a754d72 (patch)
tree35ce7d3ab51fc38fc1b2ba5f56075c2e17183b31 /lib/seqlock.h
parentlib/seqlock: avoid syscalls in no-waiter cases (diff)
downloadfrr-2a5e62359f737b233a8b06731ce60f915a754d72.tar.xz
frr-2a5e62359f737b233a8b06731ce60f915a754d72.zip
lib/seqlock: add timed-wait operation
seqlock_timedwait() puts an (absolute, CLOCK_MONOTONIC) deadline on how long we wait. The RCU code uses this for its watchdog implementation. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/seqlock.h')
-rw-r--r--lib/seqlock.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/seqlock.h b/lib/seqlock.h
index 0f5dc47cd..3cce9ccf4 100644
--- a/lib/seqlock.h
+++ b/lib/seqlock.h
@@ -82,6 +82,8 @@ extern void seqlock_init(struct seqlock *sqlo);
/* while (sqlo <= val) - wait until seqlock->pos > val, or seqlock unheld */
extern void seqlock_wait(struct seqlock *sqlo, seqlock_val_t val);
+extern bool seqlock_timedwait(struct seqlock *sqlo, seqlock_val_t val,
+ const struct timespec *abs_monotime_limit);
extern bool seqlock_check(struct seqlock *sqlo, seqlock_val_t val);
static inline bool seqlock_held(struct seqlock *sqlo)