From: Jérémie Galarneau Date: Wed, 14 Nov 2018 20:43:49 +0000 (-0500) Subject: Add an ASSERT_LOCKED(lock) macro X-Git-Tag: v2.12.0-rc1~769 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=5e5c14cef3eee00b7b3b218beed85d1a4ee2d71d;hp=5e5c14cef3eee00b7b3b218beed85d1a4ee2d71d 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 ---