summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2007-07-31 03:32:04 +0000
committerSteve Murphy <murf@digium.com>2007-07-31 03:32:04 +0000
commit2cad4fea1ae8c8478005bf5d46708e6329071164 (patch)
treec01a7d79e4e1e201e60eb9dd1c8dbf22fc644708 /channels
parent20bbd09de3f3de70a0b365082795d90614fc4532 (diff)
Discovered in experiments on core files: if you wrap the lock and unlock calls with sip_pvt_lock and sip_pvt_unlock, you lose the tracing info you would normally get via DETECT_DEADLOCKS; so I turn these two functions into macros when DETECT_DEADLOCKS is called. This way, you get meaningful stuff in the file and func slots in the lock_info struct.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77810 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 fd0ef4e7b..8ca5b3bab 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1841,6 +1841,7 @@ static struct ast_rtp_protocol sip_rtp = {
get_codec: sip_get_codec,
};
+#ifndef DETECT_DEADLOCKS
/*! \brief Helper function to lock, hiding the underlying locking mechanism. */
static void sip_pvt_lock(struct sip_pvt *pvt)
{
@@ -1852,6 +1853,12 @@ static void sip_pvt_unlock(struct sip_pvt *pvt)
{
ast_mutex_unlock(&pvt->pvt_lock);
}
+#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 sip_pvt_lock(x) ast_mutex_lock(&x->pvt_lock)
+#define sip_pvt_unlock(x) ast_mutex_unlock(&x->pvt_lock)
+#endif
/*!
* helper functions to unreference various types of objects.