]> git.proxmox.com Git - mirror_frr.git/commit - zebra/zserv.c
lib: add frr_with_mutex() block-wrapper
authorDavid Lamparter <equinox@diac24.net>
Fri, 21 Jun 2019 08:58:02 +0000 (10:58 +0200)
committerDavid Lamparter <equinox@diac24.net>
Tue, 3 Sep 2019 15:15:17 +0000 (17:15 +0200)
commit00dffa8cde7661e00245ebe1b1eea248b8dd6802
treea1e698d6b613b63407b3ad786565d09c7e7b7382
parent48373d46f1e82fb0413831fa85304cea5c1db766
lib: add frr_with_mutex() block-wrapper

frr_with_mutex(...) { ... } locks and automatically unlocks the listed
mutex(es) when the block is exited.  This adds a bit of safety against
forgetting the unlock in error paths & co. and makes the code a slight
bit more readable.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
19 files changed:
.clang-format
bgpd/bgp_fsm.c
bgpd/bgp_io.c
bgpd/bgp_keepalives.c
bgpd/bgp_packet.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/vnc_zebra.c
lib/ferr.c
lib/frr_pthread.c
lib/frr_pthread.h
lib/hash.c
lib/log.c
lib/northbound.c
lib/privs.c
lib/stream.c
lib/thread.c
tools/coccinelle/frr_with_mutex.cocci [new file with mode: 0644]
zebra/zebra_rib.c
zebra/zserv.c