mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
A small enhancement-- I added the routine log_show_lock to utils.c, which if the mentioned lock has been acquired, this routine will log to the console the normal info about that lock you'd see from the CLI when you do a 'core show locks'. It's solely for debug-- if the lock is NOT acquired, there is no output. I use it to show 'unexpected' locks, to see where/why a lock is pre-locked. This command is to be called from points of interest, like just before a trylock, and helps to spot fleeting, highly temporal locks that normally are not locked...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -186,6 +186,18 @@ void ast_remove_lock_info(void *lock_addr);
|
||||
#define ast_remove_lock_info(ignore)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief log info for the current lock with ast_log().
|
||||
*
|
||||
* this function would be mostly for debug. If you come across a lock
|
||||
* that is unexpectedly but momentarily locked, and you wonder who
|
||||
* are fighting with for the lock, this routine could be called, IF
|
||||
* you have the thread debugging stuff turned on.
|
||||
*/
|
||||
void log_show_lock(void *this_lock_addr);
|
||||
|
||||
static void __attribute__((constructor)) init_empty_mutex(void)
|
||||
{
|
||||
memset(&empty_mutex, 0, sizeof(empty_mutex));
|
||||
|
Reference in New Issue
Block a user