]> git.ipfire.org Git - thirdparty/asterisk.git/commit
lock.c: Separate DETECT_DEADLOCKS from DEBUG_THREADS
authorGeorge Joseph <gjoseph@sangoma.com>
Wed, 13 Sep 2023 15:18:04 +0000 (09:18 -0600)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Fri, 22 Sep 2023 14:34:46 +0000 (14:34 +0000)
commit13ccbc1d08034ad415f4ad416d4900c5aa99ff9b
treebe096021afabb925615cf544d6a86417bc520fae
parent95313d4727dabc1ab477ef24d4b92773ecd6a0b5
lock.c: Separate DETECT_DEADLOCKS from DEBUG_THREADS

Previously, DETECT_DEADLOCKS depended on DEBUG_THREADS.
Unfortunately, DEBUG_THREADS adds a lot of lock tracking overhead
to all of the lock lifecycle calls whereas DETECT_DEADLOCKS just
causes the lock calls to loop over trylock in 200us intervals until
the lock is obtained and spits out log messages if it takes more
than 5 seconds.  From a code perspective, the only reason they were
tied together was for logging.  So... The ifdefs in lock.c were
refactored to allow DETECT_DEADLOCKS to be enabled without
also enabling DEBUG_THREADS.

Resolves: #321

UserNote: You no longer need to select DEBUG_THREADS to use
DETECT_DEADLOCKS.  This removes a significant amount of overhead
if you just want to detect possible deadlocks vs needing full
lock tracing.
build_tools/cflags-devmode.xml
include/asterisk/lock.h
main/lock.c