summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2007-07-31 15:59:01 +0000
committerSteve Murphy <murf@digium.com>2007-07-31 15:59:01 +0000
commit35499c7f40b60d950fff08e86397ba2a2f6c3e31 (patch)
treed4fa9b293a7fbd0dacf63532102100f777c7f6bd /channels
parent5610bc06ea0aae0ff1d790fece55397daf3ce248 (diff)
thanks to Russel, for pointing out that the dialoglist_lock/unlock routines also need to be macros if DETECT_DEADLOCKS is set
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4770c9cee..f2f031e3a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1136,6 +1136,7 @@ static struct sip_pvt *dialoglist = NULL;
/*! \brief Protect the SIP dialog list (of sip_pvt's) */
AST_MUTEX_DEFINE_STATIC(dialoglock);
+#ifndef DETECT_DEADLOCKS
/*! \brief hide the way the list is locked/unlocked */
static void dialoglist_lock(void)
{
@@ -1146,6 +1147,12 @@ static void dialoglist_unlock(void)
{
ast_mutex_unlock(&dialoglock);
}
+#else
+/* we don't want to HIDE the information about where the lock was requested if trying to debug
+ * deadlocks! So, just make these macros! */
+#define dialoglist_lock(x) ast_mutex_lock(&dialoglock)
+#define dialoglist_unlock(x) ast_mutex_unlock(&dialoglock)
+#endif
/*!
* when we create or delete references, make sure to use these