summaryrefslogtreecommitdiffstats
path: root/.clang-format
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-06-21 10:58:02 +0200
committerDavid Lamparter <equinox@diac24.net>2019-09-03 17:15:17 +0200
commit00dffa8cde7661e00245ebe1b1eea248b8dd6802 (patch)
treea1e698d6b613b63407b3ad786565d09c7e7b7382 /.clang-format
parentlib: add some macro helpers (diff)
downloadfrr-00dffa8cde7661e00245ebe1b1eea248b8dd6802.tar.xz
frr-00dffa8cde7661e00245ebe1b1eea248b8dd6802.zip
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>
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format2
1 files changed, 2 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
index 4bd962747..cc68de7b5 100644
--- a/.clang-format
+++ b/.clang-format
@@ -28,6 +28,8 @@ ForEachMacros:
- frr_each
- frr_each_safe
- frr_each_from
+ - frr_with_mutex
+ - frr_elevate_privs
- LIST_FOREACH
- LIST_FOREACH_SAFE
- SLIST_FOREACH