Add an ASSERT_LOCKED(lock) macro
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Nov 2018 20:43:49 +0000 (15:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 16 Nov 2018 18:49:51 +0000 (13:49 -0500)
commit5e5c14cef3eee00b7b3b218beed85d1a4ee2d71d
tree76840d30dafda4442f96b292b8126c0a0812ce93
parenta7333da73c2083281c5ec833d041b7acf0d10d0b
Add an ASSERT_LOCKED(lock) macro

This macro validates that a given lock is taken by using
pthread_mutex_trylock().

The use of this macro is disouraged in hot paths for performance
reasons. It is meant to catch errors in "cold" code path (e.g. error
handling) where the additional safety it provides has no material
effect on performance.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/macros.h
This page took 0.026336 seconds and 4 git commands to generate.