diff options
author | Olle Johansson <oej@edvina.net> | 2006-04-15 15:07:39 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2006-04-15 15:07:39 +0000 |
commit | e75fa470999b05a0fece851f3a29a7e9e89f49f7 (patch) | |
tree | 04a6d2aa63e60fb7c1f57e90591243430cf6514d /include | |
parent | 6b3367bf5c22dda34d59dd2174f9555d3ad60a54 (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: https://origsvn.digium.com/svn/asterisk/trunk@20295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/lock.h | 20 |
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 */ |