aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 08:07:50 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 08:07:50 +0000
commitf33b337077b11c3d312e9e0e87a1f675c8dd235b (patch)
tree8e37585dc242426cd3070d0e6771d0af748f60ca /include
parent91102c5a2cae50a81cc3e135cad4d297aa5d71d6 (diff)
New functions for locking a channel - these simplify debugging
when you have channel locking issues. (Part of the SIP transfer patch, where I had a *lot* of channel locking problems) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20264 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-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 97deac143..ab6dde3fc 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -761,4 +761,16 @@ 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);
+/*! \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);
+/*! \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);
+#endif
+
#endif /* _ASTERISK_LOCK_H */