mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-13 13:28:34 +00:00
Merged revisions 187428 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r187428 | tilghman | 2009-04-09 13:08:20 -0500 (Thu, 09 Apr 2009) | 8 lines Race condition between ast_cli_command() and 'module unload' could cause a deadlock. Add lock timeouts to avoid this potential deadlock. (closes issue #14705) Reported by: jamessan Patches: 20090320__bug14705.diff.txt uploaded by tilghman (license 14) Tested by: jamessan ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -51,6 +51,18 @@
|
||||
#define AST_RWLIST_WRLOCK(head) \
|
||||
ast_rwlock_wrlock(&(head)->lock)
|
||||
|
||||
/*!
|
||||
\brief Write locks a list, with timeout.
|
||||
\param head This is a pointer to the list head structure
|
||||
\param tv Pointer to a timeval structure
|
||||
|
||||
This macro attempts to place an exclusive write lock in the
|
||||
list head structure pointed to by head.
|
||||
\retval 0 on success
|
||||
\retval non-zero on failure
|
||||
*/
|
||||
#define AST_RWLIST_TIMEDWRLOCK(head,tv) ast_rwlock_timedwrlock(&(head)->lock, tv)
|
||||
|
||||
/*!
|
||||
\brief Read locks a list.
|
||||
\param head This is a pointer to the list head structure
|
||||
@@ -63,6 +75,19 @@
|
||||
#define AST_RWLIST_RDLOCK(head) \
|
||||
ast_rwlock_rdlock(&(head)->lock)
|
||||
|
||||
/*!
|
||||
\brief Read locks a list, with timeout.
|
||||
\param head This is a pointer to the list head structure
|
||||
\param tv Pointer to a timeval structure
|
||||
|
||||
This macro attempts to place a read lock in the
|
||||
list head structure pointed to by head.
|
||||
\retval 0 on success
|
||||
\retval non-zero on failure
|
||||
*/
|
||||
#define AST_RWLIST_TIMEDRDLOCK(head,tv) \
|
||||
ast_rwlock_timedrdlock(&(head)->lock, tv)
|
||||
|
||||
/*!
|
||||
\brief Locks a list, without blocking if the list is locked.
|
||||
\param head This is a pointer to the list head structure
|
||||
|
||||
Reference in New Issue
Block a user