aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/lock.h
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-15 16:20:47 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-15 16:20:47 +0000
commit6a4d64e3efa12ea468993aac9388d06c167e7b37 (patch)
tree893184ac838560b42d47dd3e9c413812c920645b /include/asterisk/lock.h
parentf8295541144551635f59cd789a768764e2266591 (diff)
access channel locks through ast_channel_lock/unlock/trylock and not
through ast_mutex primitives. To detect all occurrences, I have renamed the lock field in struct ast_channel so it is clear that it shouldn't be used directly. There are some uses in res/res_features.c (see details of the diff) that are error prone as they try and lock two channels without caring about the order (or without explaining why it is safe). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89293 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/lock.h')
-rw-r--r--include/asterisk/lock.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index c04d00aaa..52164ed03 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -1167,13 +1167,13 @@ AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
#ifndef DEBUG_CHANNEL_LOCKS
/*! \brief Lock a channel. If DEBUG_CHANNEL_LOCKS is defined
in the Makefile, print relevant output for debugging */
-#define ast_channel_lock(x) ast_mutex_lock(&x->lock)
+#define ast_channel_lock(x) ast_mutex_lock(&x->lock_dont_use)
/*! \brief Unlock a channel. If DEBUG_CHANNEL_LOCKS is defined
in the Makefile, print relevant output for debugging */
-#define ast_channel_unlock(x) ast_mutex_unlock(&x->lock)
+#define ast_channel_unlock(x) ast_mutex_unlock(&x->lock_dont_use)
/*! \brief Try locking a channel. If DEBUG_CHANNEL_LOCKS is defined
in the Makefile, print relevant output for debugging */
-#define ast_channel_trylock(x) ast_mutex_trylock(&x->lock)
+#define ast_channel_trylock(x) ast_mutex_trylock(&x->lock_dont_use)
#else
struct ast_channel;