mutex: add nxrmutex_is_recursive api
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
a2b8c83e0e
commit
667de7be32
@ -392,6 +392,22 @@ int nxrmutex_destroy(FAR rmutex_t *rmutex);
|
||||
|
||||
bool nxrmutex_is_hold(FAR rmutex_t *rmutex);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxrmutex_is_recursive
|
||||
*
|
||||
* Description:
|
||||
* This function check whether the recursive mutex is recursive
|
||||
*
|
||||
* Parameters:
|
||||
* rmutex - Recursive mutex descriptor.
|
||||
*
|
||||
* Return Value:
|
||||
* If rmutex has returned to True recursively, otherwise returns false.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool nxrmutex_is_recursive(FAR rmutex_t *rmutex);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxrmutex_get_holder
|
||||
*
|
||||
|
@ -553,6 +553,25 @@ bool nxrmutex_is_hold(FAR rmutex_t *rmutex)
|
||||
return nxmutex_is_hold(&rmutex->mutex);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxrmutex_is_recursive
|
||||
*
|
||||
* Description:
|
||||
* This function check whether the recursive mutex is recursive
|
||||
*
|
||||
* Parameters:
|
||||
* rmutex - Recursive mutex descriptor.
|
||||
*
|
||||
* Return Value:
|
||||
* If rmutex has returned to True recursively, otherwise returns false.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool nxrmutex_is_recursive(FAR rmutex_t *rmutex)
|
||||
{
|
||||
return rmutex->count > 1;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxrmutex_get_holder
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user