diff options
author | Mark Stapp <mjs@voltanet.io> | 2018-09-27 21:10:54 +0200 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2018-11-21 16:38:08 +0100 |
commit | ad6aad4d0bc06f7711d05e1d05576ea25aac04c5 (patch) | |
tree | 93dbdea7ac22254f29aa95d89c92580314beb0e1 /zebra/zebra_dplane.h | |
parent | zebra: improve dataplane shutdown checks (diff) | |
download | frr-ad6aad4d0bc06f7711d05e1d05576ea25aac04c5.tar.xz frr-ad6aad4d0bc06f7711d05e1d05576ea25aac04c5.zip |
zebra: dplane lock and thread_master apis
Improve, simplify dataplane provider locking apis. Add accessor
for dataplane pthread's thread_master, for use by providers who
need to use the thread/event apis.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_dplane.h')
-rw-r--r-- | zebra/zebra_dplane.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 2e64540d6..b6b2e6460 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -288,7 +288,16 @@ uint32_t dplane_provider_get_id(const struct zebra_dplane_provider *prov); void *dplane_provider_get_data(const struct zebra_dplane_provider *prov); bool dplane_provider_is_threaded(const struct zebra_dplane_provider *prov); -/* Providers should limit number of updates per work cycle */ +/* Lock/unlock a provider's mutex - iff the provider was registered with + * the THREADED flag. + */ +void dplane_provider_lock(struct zebra_dplane_provider *prov); +void dplane_provider_unlock(struct zebra_dplane_provider *prov); + +/* Obtain thread_master for dataplane thread */ +struct thread_master *dplane_get_thread_master(void); + +/* Providers should (generally) limit number of updates per work cycle */ int dplane_provider_get_work_limit(const struct zebra_dplane_provider *prov); /* Provider api to signal that work/events are available |