misc/mutex: fix assertion if nxmutex_reset() before nxmutex_unlock()

sim/rpserver

NuttShell (NSH) NuttX-12.0.0
server> cu
_assert: Current Version: NuttX server 12.0.0 3ead669e7a-dirty Feb  2 2023 23:53:48 sim
_assert: Assertion failed : at file: libs/libc/misc/lib_mutex.c:303 task: cu 0x5662fff4

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-02-03 00:07:05 +08:00
committed by Xiang Xiao
parent edfae1fe21
commit 02a9e76f73
2 changed files with 43 additions and 30 deletions
+2 -6
View File
@@ -248,12 +248,10 @@ int nxmutex_unlock(FAR mutex_t *mutex);
* Parameters:
* mutex - mutex descriptor.
*
* Return Value:
*
****************************************************************************/
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
int nxmutex_reset(FAR mutex_t *mutex);
void nxmutex_reset(FAR mutex_t *mutex);
#endif
/****************************************************************************
@@ -472,11 +470,9 @@ int nxrmutex_unlock(FAR rmutex_t *rmutex);
* Parameters:
* rmutex - rmutex descriptor.
*
* Return Value:
*
****************************************************************************/
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
int nxrmutex_reset(FAR rmutex_t *rmutex);
void nxrmutex_reset(FAR rmutex_t *rmutex);
#endif
/****************************************************************************