Add some clarification comments on the mutex api
Some checks failed
Build Documentation / build-html (push) Has been cancelled

This commit is contained in:
YAMAMOTO Takashi 2024-12-24 10:49:00 +09:00 committed by Xiang Xiao
parent 28937fed4d
commit 958e30b3e2
2 changed files with 30 additions and 6 deletions

View file

@ -124,7 +124,7 @@ int nxmutex_destroy(FAR mutex_t *mutex);
* Name: nxmutex_is_hold * Name: nxmutex_is_hold
* *
* Description: * Description:
* This function check whether the caller hold the mutex * This function check whether the calling thread hold the mutex
* referenced by 'mutex'. * referenced by 'mutex'.
* *
* Parameters: * Parameters:
@ -141,6 +141,8 @@ bool nxmutex_is_hold(FAR mutex_t *mutex);
* *
* Description: * Description:
* This function get the holder of the mutex referenced by 'mutex'. * This function get the holder of the mutex referenced by 'mutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* mutex - mutex descriptor. * mutex - mutex descriptor.
@ -156,6 +158,8 @@ int nxmutex_get_holder(FAR mutex_t *mutex);
* *
* Description: * Description:
* This function get the lock state the mutex referenced by 'mutex'. * This function get the lock state the mutex referenced by 'mutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* mutex - mutex descriptor. * mutex - mutex descriptor.
@ -444,7 +448,7 @@ int nxrmutex_destroy(FAR rmutex_t *rmutex);
* Name: nxrmutex_is_hold * Name: nxrmutex_is_hold
* *
* Description: * Description:
* This function check whether the caller hold the recursive mutex * This function check whether the calling thread hold the recursive mutex
* referenced by 'rmutex'. * referenced by 'rmutex'.
* *
* Parameters: * Parameters:
@ -460,7 +464,11 @@ bool nxrmutex_is_hold(FAR rmutex_t *rmutex);
* Name: nxrmutex_is_recursive * Name: nxrmutex_is_recursive
* *
* Description: * Description:
* This function check whether the recursive mutex is recursive * This function check whether the recursive mutex is currently held
* recursively. That is, whether it's locked more than once by the
* current holder.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* rmutex - Recursive mutex descriptor. * rmutex - Recursive mutex descriptor.
@ -477,6 +485,8 @@ bool nxrmutex_is_recursive(FAR rmutex_t *rmutex);
* *
* Description: * Description:
* This function get the holder of the mutex referenced by 'mutex'. * This function get the holder of the mutex referenced by 'mutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* rmutex - Rmutex descriptor. * rmutex - Rmutex descriptor.
@ -493,6 +503,8 @@ int nxrmutex_get_holder(FAR rmutex_t *rmutex);
* Description: * Description:
* This function get the lock state the recursive mutex * This function get the lock state the recursive mutex
* referenced by 'rmutex'. * referenced by 'rmutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* rmutex - Recursive mutex descriptor. * rmutex - Recursive mutex descriptor.

View file

@ -165,7 +165,7 @@ int nxmutex_destroy(FAR mutex_t *mutex)
* Name: nxmutex_is_hold * Name: nxmutex_is_hold
* *
* Description: * Description:
* This function check whether the caller hold the mutex * This function check whether the calling thread hold the mutex
* referenced by 'mutex'. * referenced by 'mutex'.
* *
* Parameters: * Parameters:
@ -185,6 +185,8 @@ bool nxmutex_is_hold(FAR mutex_t *mutex)
* *
* Description: * Description:
* This function get the holder of the mutex referenced by 'mutex'. * This function get the holder of the mutex referenced by 'mutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* mutex - mutex descriptor. * mutex - mutex descriptor.
@ -203,6 +205,8 @@ int nxmutex_get_holder(FAR mutex_t *mutex)
* *
* Description: * Description:
* This function get the lock state the mutex referenced by 'mutex'. * This function get the lock state the mutex referenced by 'mutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* mutex - mutex descriptor. * mutex - mutex descriptor.
@ -645,7 +649,7 @@ int nxrmutex_destroy(FAR rmutex_t *rmutex)
* Name: nxrmutex_is_hold * Name: nxrmutex_is_hold
* *
* Description: * Description:
* This function check whether the caller hold the recursive mutex * This function check whether the calling thread hold the recursive mutex
* referenced by 'rmutex'. * referenced by 'rmutex'.
* *
* Parameters: * Parameters:
@ -664,7 +668,11 @@ bool nxrmutex_is_hold(FAR rmutex_t *rmutex)
* Name: nxrmutex_is_recursive * Name: nxrmutex_is_recursive
* *
* Description: * Description:
* This function check whether the recursive mutex is recursive * This function check whether the recursive mutex is currently held
* recursively. That is, whether it's locked more than once by the
* current holder.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* rmutex - Recursive mutex descriptor. * rmutex - Recursive mutex descriptor.
@ -684,6 +692,8 @@ bool nxrmutex_is_recursive(FAR rmutex_t *rmutex)
* *
* Description: * Description:
* This function get the holder of the mutex referenced by 'mutex'. * This function get the holder of the mutex referenced by 'mutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* rmutex - Rmutex descriptor. * rmutex - Rmutex descriptor.
@ -703,6 +713,8 @@ int nxrmutex_get_holder(FAR rmutex_t *rmutex)
* Description: * Description:
* This function get the lock state the recursive mutex * This function get the lock state the recursive mutex
* referenced by 'rmutex'. * referenced by 'rmutex'.
* Note that this is inherently racy unless the calling thread is
* holding the mutex.
* *
* Parameters: * Parameters:
* rmutex - Recursive mutex descriptor. * rmutex - Recursive mutex descriptor.