diff options
Diffstat (limited to 'include/asterisk/linkedlists.h')
-rw-r--r-- | include/asterisk/linkedlists.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h index bef63e0c0..fe09610ff 100644 --- a/include/asterisk/linkedlists.h +++ b/include/asterisk/linkedlists.h @@ -28,7 +28,7 @@ */ /*! - \brief Attempts to lock a list. + \brief Locks a list. \param head This is a pointer to the list head structure This macro attempts to place an exclusive lock in the @@ -39,6 +39,17 @@ ast_mutex_lock(&(head)->lock) /*! + \brief Locks a list, without blocking if the list is locked. + \param 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. + Returns non-zero on success, 0 on failure +*/ +#define AST_LIST_TRYLOCK(head) \ + ast_mutex_trylock(&(head)->lock) + +/*! \brief Attempts to unlock a list. \param head This is a pointer to the list head structure @@ -209,7 +220,7 @@ struct { \ /*! \brief Returns the last entry contained in a list. - \param head This is a pointer to the list tail structure + \param head This is a pointer to the list head structure */ #define AST_LIST_LAST(head) ((head)->last) |