Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
A set of macros to manage forward-linked lists. More...
#include "asterisk/lock.h"
Go to the source code of this file.
Macros | |
#define | AST_LIST_APPEND_LIST(head, list, field) |
Appends a whole list to the tail of a list. More... | |
#define | AST_LIST_EMPTY(head) (AST_LIST_FIRST(head) == NULL) |
Checks whether the specified list contains any entries. More... | |
#define | AST_LIST_ENTRY(type) |
Declare a forward link structure inside a list entry. More... | |
#define | AST_LIST_FIRST(head) ((head)->first) |
Returns the first entry contained in a list. More... | |
#define | AST_LIST_HEAD(name, type) |
Defines a structure to be used to hold a list of specified type. More... | |
#define | AST_LIST_HEAD_DESTROY(head) |
Destroys a list head structure. More... | |
#define | AST_LIST_HEAD_INIT(head) |
Initializes a list head structure. More... | |
#define | AST_LIST_HEAD_INIT_NOLOCK(head) |
Initializes a list head structure. More... | |
#define | AST_LIST_HEAD_INIT_VALUE |
Defines initial values for a declaration of AST_LIST_HEAD. More... | |
#define | AST_LIST_HEAD_NOLOCK(name, type) |
Defines a structure to be used to hold a list of specified type (with no lock). More... | |
#define | AST_LIST_HEAD_NOLOCK_INIT_VALUE |
Defines initial values for a declaration of AST_LIST_HEAD_NOLOCK. More... | |
#define | AST_LIST_HEAD_NOLOCK_STATIC(name, type) |
Defines a structure to be used to hold a list of specified type, statically initialized. More... | |
#define | AST_LIST_HEAD_SET(head, entry) |
Initializes a list head structure with a specified first entry. More... | |
#define | AST_LIST_HEAD_SET_NOLOCK(head, entry) |
Initializes a list head structure with a specified first entry. More... | |
#define | AST_LIST_HEAD_STATIC(name, type) |
Defines a structure to be used to hold a list of specified type, statically initialized. More... | |
#define | AST_LIST_INSERT_AFTER(head, listelm, elm, field) |
Inserts a list entry after a given entry. More... | |
#define | AST_LIST_INSERT_BEFORE_CURRENT(elm, field) |
Inserts a list entry before the current entry during a traversal. More... | |
#define | AST_LIST_INSERT_HEAD(head, elm, field) |
Inserts a list entry at the head of a list. More... | |
#define | AST_LIST_INSERT_LIST_AFTER(head, list, elm, field) |
Inserts a whole list after a specific entry in a list. More... | |
#define | AST_LIST_INSERT_SORTALPHA(head, elm, field, sortfield) |
Inserts a list entry into a alphabetically sorted list. More... | |
#define | AST_LIST_INSERT_TAIL(head, elm, field) |
Appends a list entry to the tail of a list. More... | |
#define | AST_LIST_LAST(head) ((head)->last) |
Returns the last entry contained in a list. More... | |
#define | AST_LIST_LOCK(head) ast_mutex_lock(&(head)->lock) |
Locks a list. More... | |
#define | AST_LIST_MOVE_CURRENT(newhead, field) |
Move the current list entry to another list. More... | |
#define | AST_LIST_NEXT(elm, field) ((elm)->field.next) |
Returns the next entry in the list after the given entry. More... | |
#define | AST_LIST_REMOVE(head, elm, field) |
Removes a specific entry from a list. More... | |
#define | AST_LIST_REMOVE_CURRENT(field) |
Removes the current entry from a list during a traversal. More... | |
#define | AST_LIST_REMOVE_HEAD(head, field) |
Removes and returns the head entry from a list. More... | |
#define | AST_LIST_TRAVERSE(head, var, field) for((var) = (head)->first; (var); (var) = (var)->field.next) |
Loops over (traverses) the entries in a list. More... | |
#define | AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field) |
Loops safely over (traverses) the entries in a list. More... | |
#define | AST_LIST_TRAVERSE_SAFE_END } |
Closes a safe loop traversal block. More... | |
#define | AST_LIST_TRYLOCK(head) ast_mutex_trylock(&(head)->lock) |
Locks a list, without blocking if the list is locked. More... | |
#define | AST_LIST_UNLOCK(head) ast_mutex_unlock(&(head)->lock) |
Attempts to unlock a list. More... | |
#define | AST_RWLIST_APPEND_LIST AST_LIST_APPEND_LIST |
#define | AST_RWLIST_EMPTY AST_LIST_EMPTY |
#define | AST_RWLIST_ENTRY AST_LIST_ENTRY |
#define | AST_RWLIST_FIRST AST_LIST_FIRST |
#define | AST_RWLIST_HEAD(name, type) |
Defines a structure to be used to hold a read/write list of specified type. More... | |
#define | AST_RWLIST_HEAD_DESTROY(head) |
Destroys an rwlist head structure. More... | |
#define | AST_RWLIST_HEAD_INIT(head) |
Initializes an rwlist head structure. More... | |
#define | AST_RWLIST_HEAD_INIT_VALUE |
Defines initial values for a declaration of AST_RWLIST_HEAD. More... | |
#define | AST_RWLIST_HEAD_SET(head, entry) |
Initializes an rwlist head structure with a specified first entry. More... | |
#define | AST_RWLIST_HEAD_STATIC(name, type) |
Defines a structure to be used to hold a read/write list of specified type, statically initialized. More... | |
#define | AST_RWLIST_INSERT_AFTER AST_LIST_INSERT_AFTER |
#define | AST_RWLIST_INSERT_BEFORE_CURRENT AST_LIST_INSERT_BEFORE_CURRENT |
#define | AST_RWLIST_INSERT_HEAD AST_LIST_INSERT_HEAD |
#define | AST_RWLIST_INSERT_LIST_AFTER AST_LIST_INSERT_LIST_AFTER |
#define | AST_RWLIST_INSERT_SORTALPHA AST_LIST_INSERT_SORTALPHA |
#define | AST_RWLIST_INSERT_TAIL AST_LIST_INSERT_TAIL |
#define | AST_RWLIST_LAST AST_LIST_LAST |
#define | AST_RWLIST_MOVE_CURRENT AST_LIST_MOVE_CURRENT |
#define | AST_RWLIST_NEXT AST_LIST_NEXT |
#define | AST_RWLIST_RDLOCK(head) ast_rwlock_rdlock(&(head)->lock) |
Read locks a list. More... | |
#define | AST_RWLIST_REMOVE AST_LIST_REMOVE |
#define | AST_RWLIST_REMOVE_CURRENT AST_LIST_REMOVE_CURRENT |
#define | AST_RWLIST_REMOVE_HEAD AST_LIST_REMOVE_HEAD |
#define | AST_RWLIST_TIMEDRDLOCK(head, ts) ast_rwlock_timedrdlock(&(head)->lock, ts) |
Read locks a list, with timeout. More... | |
#define | AST_RWLIST_TIMEDWRLOCK(head, ts) ast_rwlock_timedwrlock(&(head)->lock, ts) |
Write locks a list, with timeout. More... | |
#define | AST_RWLIST_TRAVERSE AST_LIST_TRAVERSE |
#define | AST_RWLIST_TRAVERSE_SAFE_BEGIN AST_LIST_TRAVERSE_SAFE_BEGIN |
#define | AST_RWLIST_TRAVERSE_SAFE_END AST_LIST_TRAVERSE_SAFE_END |
#define | AST_RWLIST_TRYRDLOCK(head) ast_rwlock_tryrdlock(&(head)->lock) |
Read locks a list, without blocking if the list is locked. More... | |
#define | AST_RWLIST_TRYWRLOCK(head) ast_rwlock_trywrlock(&(head)->lock) |
Write locks a list, without blocking if the list is locked. More... | |
#define | AST_RWLIST_UNLOCK(head) ast_rwlock_unlock(&(head)->lock) |
Attempts to unlock a read/write based list. More... | |
#define | AST_RWLIST_WRLOCK(head) ast_rwlock_wrlock(&(head)->lock) |
Write locks a list. More... | |
A set of macros to manage forward-linked lists.
Definition in file linkedlists.h.
#define AST_LIST_APPEND_LIST | ( | head, | |
list, | |||
field | |||
) |
Appends a whole list to the tail of a list.
head | This is a pointer to the list head structure |
list | This is a pointer to the list to be appended. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Note: The source list (the list parameter) will be empty after calling this macro (the list entries are moved to the target list).
Definition at line 783 of file linkedlists.h.
#define AST_LIST_EMPTY | ( | head | ) | (AST_LIST_FIRST(head) == NULL) |
Checks whether the specified list contains any entries.
head | This is a pointer to the list head structure |
Definition at line 450 of file linkedlists.h.
#define AST_LIST_ENTRY | ( | type | ) |
Declare a forward link structure inside a list entry.
type | This is the type of each list entry. |
This macro declares a structure to be used to link list entries together. It must be used inside the definition of the structure named in type, as follows:
The field name list here is arbitrary, and can be anything you wish.
Definition at line 410 of file linkedlists.h.
#define AST_LIST_FIRST | ( | head | ) | ((head)->first) |
Returns the first entry contained in a list.
head | This is a pointer to the list head structure |
Definition at line 421 of file linkedlists.h.
Defines a structure to be used to hold a list of specified type.
name | This will be the name of the defined structure. |
type | This is the type of each list entry. |
This macro creates a structure definition that can be used to hold a list of the entries of type type. It does not actually declare (allocate) a structure; to do that, either follow this macro with the desired name of the instance you wish to declare, or use the specified name to declare instances elsewhere.
Example usage:
This would define struct
entry_list
, and declare an instance of it named entries, all intended to hold a list of type struct
entry
.
Definition at line 173 of file linkedlists.h.
#define AST_LIST_HEAD_DESTROY | ( | head | ) |
Destroys a list head structure.
head | This is a pointer to the list head structure |
This macro destroys a list head structure by setting the head entry to NULL (empty list) and destroying the embedded lock. It does not free the structure from memory.
Definition at line 653 of file linkedlists.h.
#define AST_LIST_HEAD_INIT | ( | head | ) |
Initializes a list head structure.
head | This is a pointer to the list head structure |
This macro initializes a list head structure by setting the head entry to NULL (empty list) and recreating the embedded lock.
Definition at line 626 of file linkedlists.h.
#define AST_LIST_HEAD_INIT_NOLOCK | ( | head | ) |
Initializes a list head structure.
head | This is a pointer to the list head structure |
This macro initializes a list head structure by setting the head entry to NULL (empty list). There is no embedded lock handling with this macro.
Definition at line 681 of file linkedlists.h.
#define AST_LIST_HEAD_INIT_VALUE |
Defines initial values for a declaration of AST_LIST_HEAD.
Definition at line 234 of file linkedlists.h.
Defines a structure to be used to hold a list of specified type (with no lock).
name | This will be the name of the defined structure. |
type | This is the type of each list entry. |
This macro creates a structure definition that can be used to hold a list of the entries of type type. It does not actually declare (allocate) a structure; to do that, either follow this macro with the desired name of the instance you wish to declare, or use the specified name to declare instances elsewhere.
Example usage:
This would define struct
entry_list
, and declare an instance of it named entries, all intended to hold a list of type struct
entry
.
Definition at line 225 of file linkedlists.h.
#define AST_LIST_HEAD_NOLOCK_INIT_VALUE |
Defines initial values for a declaration of AST_LIST_HEAD_NOLOCK.
Definition at line 252 of file linkedlists.h.
Defines a structure to be used to hold a list of specified type, statically initialized.
This is the same as AST_LIST_HEAD_STATIC, except without the lock included.
Definition at line 346 of file linkedlists.h.
#define AST_LIST_HEAD_SET | ( | head, | |
entry | |||
) |
Initializes a list head structure with a specified first entry.
head | This is a pointer to the list head structure |
entry | pointer to the list entry that will become the head of the list |
This macro initializes a list head structure by setting the head entry to the supplied value and recreating the embedded lock.
Definition at line 360 of file linkedlists.h.
#define AST_LIST_HEAD_SET_NOLOCK | ( | head, | |
entry | |||
) |
Initializes a list head structure with a specified first entry.
head | This is a pointer to the list head structure |
entry | pointer to the list entry that will become the head of the list |
This macro initializes a list head structure by setting the head entry to the supplied value.
Definition at line 388 of file linkedlists.h.
Defines a structure to be used to hold a list of specified type, statically initialized.
name | This will be the name of the defined structure. |
type | This is the type of each list entry. |
This macro creates a structure definition that can be used to hold a list of the entries of type type, and allocates an instance of it, initialized to be empty.
Example usage:
This would define struct
entry_list
, intended to hold a list of type struct
entry
.
Definition at line 291 of file linkedlists.h.
#define AST_LIST_INSERT_AFTER | ( | head, | |
listelm, | |||
elm, | |||
field | |||
) |
Inserts a list entry after a given entry.
head | This is a pointer to the list head structure |
listelm | This is a pointer to the entry after which the new entry should be inserted. |
elm | This is a pointer to the entry to be inserted. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Definition at line 695 of file linkedlists.h.
#define AST_LIST_INSERT_BEFORE_CURRENT | ( | elm, | |
field | |||
) |
Inserts a list entry before the current entry during a traversal.
elm | This is a pointer to the entry to be inserted. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Definition at line 599 of file linkedlists.h.
#define AST_LIST_INSERT_HEAD | ( | head, | |
elm, | |||
field | |||
) |
Inserts a list entry at the head of a list.
head | This is a pointer to the list head structure |
elm | This is a pointer to the entry to be inserted. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Definition at line 711 of file linkedlists.h.
#define AST_LIST_INSERT_LIST_AFTER | ( | head, | |
list, | |||
elm, | |||
field | |||
) |
Inserts a whole list after a specific entry in a list.
head | This is a pointer to the list head structure |
list | This is a pointer to the list to be inserted. |
elm | This is a pointer to the entry after which the new list should be inserted. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of the lists together. |
Note: The source list (the list parameter) will be empty after calling this macro (the list entries are moved to the target list).
Definition at line 812 of file linkedlists.h.
#define AST_LIST_INSERT_SORTALPHA | ( | head, | |
elm, | |||
field, | |||
sortfield | |||
) |
Inserts a list entry into a alphabetically sorted list.
head | Pointer to the list head structure |
elm | Pointer to the entry to be inserted |
field | Name of the list entry field (declared using AST_LIST_ENTRY()) |
sortfield | Name of the field on which the list is sorted |
Definition at line 751 of file linkedlists.h.
#define AST_LIST_INSERT_TAIL | ( | head, | |
elm, | |||
field | |||
) |
Appends a list entry to the tail of a list.
head | This is a pointer to the list head structure |
elm | This is a pointer to the entry to be appended. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Note: The link field in the appended entry is not modified, so if it is actually the head of a list itself, the entire list will be appended temporarily (until the next AST_LIST_INSERT_TAIL is performed).
Definition at line 731 of file linkedlists.h.
#define AST_LIST_LAST | ( | head | ) | ((head)->last) |
Returns the last entry contained in a list.
head | This is a pointer to the list head structure |
Definition at line 429 of file linkedlists.h.
#define AST_LIST_LOCK | ( | head | ) | ast_mutex_lock(&(head)->lock) |
Locks a list.
head | This is a pointer to the list head structure |
This macro attempts to place an exclusive lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 40 of file linkedlists.h.
#define AST_LIST_MOVE_CURRENT | ( | newhead, | |
field | |||
) |
Move the current list entry to another list.
AST_LIST_REMOVE_CURRENT(field); AST_LIST_INSERT_TAIL(newhead, var, other_field);
Definition at line 582 of file linkedlists.h.
#define AST_LIST_NEXT | ( | elm, | |
field | |||
) | ((elm)->field.next) |
Returns the next entry in the list after the given entry.
elm | This is a pointer to the current entry. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Definition at line 439 of file linkedlists.h.
#define AST_LIST_REMOVE | ( | head, | |
elm, | |||
field | |||
) |
Removes a specific entry from a list.
head | This is a pointer to the list head structure |
elm | This is a pointer to the entry to be removed. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
elm | if elm was in the list. |
NULL | if elm was not in the list or elm was NULL. |
Definition at line 856 of file linkedlists.h.
#define AST_LIST_REMOVE_CURRENT | ( | field | ) |
Removes the current entry from a list during a traversal.
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Definition at line 557 of file linkedlists.h.
#define AST_LIST_REMOVE_HEAD | ( | head, | |
field | |||
) |
Removes and returns the head entry from a list.
head | This is a pointer to the list head structure |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
Removes the head entry from the list, and returns a pointer to it. This macro is safe to call on an empty list.
Definition at line 833 of file linkedlists.h.
#define AST_LIST_TRAVERSE | ( | head, | |
var, | |||
field | |||
) | for((var) = (head)->first; (var); (var) = (var)->field.next) |
Loops over (traverses) the entries in a list.
head | This is a pointer to the list head structure |
var | This is the name of the variable that will hold a pointer to the current list entry on each iteration. It must be declared before calling this macro. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
This macro is use to loop over (traverse) the entries in a list. It uses a for loop, and supplies the enclosed code with a pointer to each list entry as it loops. It is typically used as follows:
Definition at line 491 of file linkedlists.h.
#define AST_LIST_TRAVERSE_SAFE_BEGIN | ( | head, | |
var, | |||
field | |||
) |
Loops safely over (traverses) the entries in a list.
head | This is a pointer to the list head structure |
var | This is the name of the variable that will hold a pointer to the current list entry on each iteration. It must be declared before calling this macro. |
field | This is the name of the field (declared using AST_LIST_ENTRY()) used to link entries of this list together. |
This macro is used to safely loop over (traverse) the entries in a list. It uses a for loop, and supplies the enclosed code with a pointer to each list entry as it loops. It is typically used as follows:
It differs from AST_LIST_TRAVERSE() in that the code inside the loop can modify (or even free, after calling AST_LIST_REMOVE_CURRENT()) the entry pointed to by the current pointer without affecting the loop traversal.
Definition at line 529 of file linkedlists.h.
#define AST_LIST_TRAVERSE_SAFE_END } |
Closes a safe loop traversal block.
Definition at line 615 of file linkedlists.h.
#define AST_LIST_TRYLOCK | ( | head | ) | ast_mutex_trylock(&(head)->lock) |
Locks a list, without blocking if the list is locked.
head | This is a pointer to the list head structure |
This macro attempts to place an exclusive lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 105 of file linkedlists.h.
#define AST_LIST_UNLOCK | ( | head | ) | ast_mutex_unlock(&(head)->lock) |
Attempts to unlock a list.
head | This is a pointer to the list head structure |
This macro attempts to remove an exclusive lock from the list head structure pointed to by head. If the list was not locked by this thread, this macro has no effect.
Definition at line 140 of file linkedlists.h.
#define AST_RWLIST_APPEND_LIST AST_LIST_APPEND_LIST |
Definition at line 798 of file linkedlists.h.
#define AST_RWLIST_EMPTY AST_LIST_EMPTY |
Definition at line 452 of file linkedlists.h.
#define AST_RWLIST_ENTRY AST_LIST_ENTRY |
Definition at line 415 of file linkedlists.h.
#define AST_RWLIST_FIRST AST_LIST_FIRST |
Definition at line 423 of file linkedlists.h.
Defines a structure to be used to hold a read/write list of specified type.
name | This will be the name of the defined structure. |
type | This is the type of each list entry. |
This macro creates a structure definition that can be used to hold a list of the entries of type type. It does not actually declare (allocate) a structure; to do that, either follow this macro with the desired name of the instance you wish to declare, or use the specified name to declare instances elsewhere.
Example usage:
This would define struct
entry_list
, and declare an instance of it named entries, all intended to hold a list of type struct
entry
.
Definition at line 199 of file linkedlists.h.
#define AST_RWLIST_HEAD_DESTROY | ( | head | ) |
Destroys an rwlist head structure.
head | This is a pointer to the list head structure |
This macro destroys a list head structure by setting the head entry to NULL (empty list) and destroying the embedded lock. It does not free the structure from memory.
Definition at line 667 of file linkedlists.h.
#define AST_RWLIST_HEAD_INIT | ( | head | ) |
Initializes an rwlist head structure.
head | This is a pointer to the list head structure |
This macro initializes a list head structure by setting the head entry to NULL (empty list) and recreating the embedded lock.
Definition at line 639 of file linkedlists.h.
#define AST_RWLIST_HEAD_INIT_VALUE |
Defines initial values for a declaration of AST_RWLIST_HEAD.
Definition at line 243 of file linkedlists.h.
#define AST_RWLIST_HEAD_SET | ( | head, | |
entry | |||
) |
Initializes an rwlist head structure with a specified first entry.
head | This is a pointer to the list head structure |
entry | pointer to the list entry that will become the head of the list |
This macro initializes a list head structure by setting the head entry to the supplied value and recreating the embedded lock.
Definition at line 374 of file linkedlists.h.
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
name | This will be the name of the defined structure. |
type | This is the type of each list entry. |
This macro creates a structure definition that can be used to hold a list of the entries of type type, and allocates an instance of it, initialized to be empty.
Example usage:
This would define struct
entry_list
, intended to hold a list of type struct
entry
.
Definition at line 333 of file linkedlists.h.
#define AST_RWLIST_INSERT_AFTER AST_LIST_INSERT_AFTER |
Definition at line 702 of file linkedlists.h.
#define AST_RWLIST_INSERT_BEFORE_CURRENT AST_LIST_INSERT_BEFORE_CURRENT |
Definition at line 610 of file linkedlists.h.
#define AST_RWLIST_INSERT_HEAD AST_LIST_INSERT_HEAD |
Definition at line 718 of file linkedlists.h.
#define AST_RWLIST_INSERT_LIST_AFTER AST_LIST_INSERT_LIST_AFTER |
Definition at line 822 of file linkedlists.h.
#define AST_RWLIST_INSERT_SORTALPHA AST_LIST_INSERT_SORTALPHA |
Definition at line 771 of file linkedlists.h.
#define AST_RWLIST_INSERT_TAIL AST_LIST_INSERT_TAIL |
Definition at line 741 of file linkedlists.h.
#define AST_RWLIST_LAST AST_LIST_LAST |
Definition at line 431 of file linkedlists.h.
#define AST_RWLIST_MOVE_CURRENT AST_LIST_MOVE_CURRENT |
Definition at line 588 of file linkedlists.h.
#define AST_RWLIST_NEXT AST_LIST_NEXT |
Definition at line 441 of file linkedlists.h.
#define AST_RWLIST_RDLOCK | ( | head | ) | ast_rwlock_rdlock(&(head)->lock) |
Read locks a list.
head | This is a pointer to the list head structure |
This macro attempts to place a read lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 78 of file linkedlists.h.
#define AST_RWLIST_REMOVE AST_LIST_REMOVE |
Definition at line 885 of file linkedlists.h.
#define AST_RWLIST_REMOVE_CURRENT AST_LIST_REMOVE_CURRENT |
Definition at line 570 of file linkedlists.h.
#define AST_RWLIST_REMOVE_HEAD AST_LIST_REMOVE_HEAD |
Definition at line 844 of file linkedlists.h.
#define AST_RWLIST_TIMEDRDLOCK | ( | head, | |
ts | |||
) | ast_rwlock_timedrdlock(&(head)->lock, ts) |
Read locks a list, with timeout.
head | This is a pointer to the list head structure |
ts | Pointer to a timespec structure |
This macro attempts to place a read lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 93 of file linkedlists.h.
#define AST_RWLIST_TIMEDWRLOCK | ( | head, | |
ts | |||
) | ast_rwlock_timedwrlock(&(head)->lock, ts) |
Write locks a list, with timeout.
head | This is a pointer to the list head structure |
ts | Pointer to a timespec structure |
This macro attempts to place an exclusive write lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 67 of file linkedlists.h.
#define AST_RWLIST_TRAVERSE AST_LIST_TRAVERSE |
Definition at line 494 of file linkedlists.h.
#define AST_RWLIST_TRAVERSE_SAFE_BEGIN AST_LIST_TRAVERSE_SAFE_BEGIN |
Definition at line 545 of file linkedlists.h.
#define AST_RWLIST_TRAVERSE_SAFE_END AST_LIST_TRAVERSE_SAFE_END |
Definition at line 617 of file linkedlists.h.
#define AST_RWLIST_TRYRDLOCK | ( | head | ) | ast_rwlock_tryrdlock(&(head)->lock) |
Read locks a list, without blocking if the list is locked.
head | This is a pointer to the list head structure |
This macro attempts to place a read lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 129 of file linkedlists.h.
#define AST_RWLIST_TRYWRLOCK | ( | head | ) | ast_rwlock_trywrlock(&(head)->lock) |
Write locks a list, without blocking if the list is locked.
head | This is a pointer to the list head structure |
This macro attempts to place an exclusive write lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 117 of file linkedlists.h.
#define AST_RWLIST_UNLOCK | ( | head | ) | ast_rwlock_unlock(&(head)->lock) |
Attempts to unlock a read/write based list.
head | This is a pointer to the list head structure |
This macro attempts to remove a read or write lock from the list head structure pointed to by head. If the list was not locked by this thread, this macro has no effect.
Definition at line 151 of file linkedlists.h.
#define AST_RWLIST_WRLOCK | ( | head | ) | ast_rwlock_wrlock(&(head)->lock) |
Write locks a list.
head | This is a pointer to the list head structure |
This macro attempts to place an exclusive write lock in the list head structure pointed to by head.
0 | on success |
non-zero | on failure |
Definition at line 52 of file linkedlists.h.