aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/lock.h
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-16 20:54:41 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-16 20:54:41 +0000
commitc99aa3db824dfb5a6eddf4d7d96685e8eb1767d6 (patch)
tree18e50329931323a287b2b1dff864083062d3cf62 /include/asterisk/lock.h
parent2076b702796ef1f3e8f02ff545c5b5b6869806c9 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@114187 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/lock.h')
-rw-r--r--include/asterisk/lock.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index 36c25a87d..f352a2d7d 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -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));