mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-13 13:28:34 +00:00
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
This commit is contained in:
@@ -359,6 +359,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
|
||||
|
||||
Reference in New Issue
Block a user