summaryrefslogtreecommitdiff
path: root/include/asterisk/linkedlists.h
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-04-09 18:40:01 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-04-09 18:40:01 +0000
commit39808fa953e65c9c3a2b40f6fe409adea59eb133 (patch)
tree15138023a164f80a33759fd54aa599c10202e176 /include/asterisk/linkedlists.h
parent19f381b4840f505f293610869be0f5290dc88913 (diff)
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
Diffstat (limited to 'include/asterisk/linkedlists.h')
-rw-r--r--include/asterisk/linkedlists.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index 1db0ae2db..dd5e2f6ca 100644
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -52,6 +52,18 @@
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
@@ -64,6 +76,19 @@
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