mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-28 15:11:12 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@20264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user