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 22:23:34 +0000 (17:23 -0500)
commitd7d758dd793b7b492fe6f5134f11ea0c7feaf6cc
tree9acb4c5cf4fb152bd901992bb2316c252dbb2f3e
parent51bb4dbbf2f178f09802c8aacaa7c68b1891d6fb
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.024616 seconds and 4 git commands to generate.