aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 15:07:39 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 15:07:39 +0000
commitd4561ff1d1c89af3182a7e0e05438b49c102b43f (patch)
tree04a6d2aa63e60fb7c1f57e90591243430cf6514d /include
parentf33b337077b11c3d312e9e0e87a1f675c8dd235b (diff)
More ast_channel_lock fixes
- Update lock.h with definitions of ast_channel_lock, ast_channel_unlock and ast_channel_trylock - Convert some functions (but not all) in channel.c - Fix some bugs in chan_sip.c - Convert rest of chan_sip.c git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20295 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/lock.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index ab6dde3fc..9ff56e033 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -764,13 +764,27 @@ 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)
/*! \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)
/*! \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)
+#else
+
+/*! \brief Lock AST channel (and print debugging output)
+\note You need to enable DEBUG_CHANNEL_LOCKS for this function */
+int ast_channel_lock(struct ast_channel *chan);
+
+/*! \brief Unlock AST channel (and print debugging output)
+\note You need to enable DEBUG_CHANNEL_LOCKS for this function
+*/
+int ast_channel_unlock(struct ast_channel *chan);
+
+/*! \brief Lock AST channel (and print debugging output)
+\note You need to enable DEBUG_CHANNEL_LOCKS for this function */
+int __ast_channel_trylock(struct ast_channel *chan);
#endif
#endif /* _ASTERISK_LOCK_H */