summaryrefslogtreecommitdiff
path: root/include/asterisk/linkedlists.h
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-05-23 17:04:07 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-05-23 17:04:07 +0000
commit8d74f0ebe67ba3eee5ad264594ce3af8ef971d84 (patch)
treeb13f49a12298d5f30c7901dd68d03dfabca06529 /include/asterisk/linkedlists.h
parent5d51260c36d4cb941c1c7ca4931ab254e9c66f9f (diff)
restore AST_LIST_HEAD_INIT (with no users in the tree right now)
update ast_mutex_init to allow mutexes that are all zero bytes to be initialized (in the case of a dynamically-allocated structure containing a mutex) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@29727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/linkedlists.h')
-rw-r--r--include/asterisk/linkedlists.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index a54f88368..b3b3dbf98 100644
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -360,6 +360,19 @@ struct { \
#define AST_LIST_TRAVERSE_SAFE_END }
/*!
+ \brief Initializes a list head structure.
+ \param head This is a pointer to the list head structure
+
+ This macro initializes a list head structure by setting the head
+ entry to \a NULL (empty list) and recreating the embedded lock.
+*/
+#define AST_LIST_HEAD_INIT(head) { \
+ (head)->first = NULL; \
+ (head)->last = NULL; \
+ ast_mutex_init(&(head)->lock); \
+}
+
+/*!
\brief Destroys a list head structure.
\param head This is a pointer to the list head structure