From 4af6db7c8006b2e8219e1698baccf910f94a182c Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Sun, 5 May 2024 11:28:49 +0800 Subject: [PATCH] mutex: remove mutex trylock holder check The standard describes trylock as follows, trylock should never cause the system to stop running: The pthread_mutex_trylock() function shall be equivalent to pthread_mutex_lock(), except that if the mutex object referenced by mutex is currently locked (by any thread, including the current thread), the call shall return immediately. https://linux.die.net/man/3/pthread_mutex_trylock Signed-off-by: yinshengkai --- libs/libc/misc/lib_mutex.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/libc/misc/lib_mutex.c b/libs/libc/misc/lib_mutex.c index 2518f3022d..379c812d06 100644 --- a/libs/libc/misc/lib_mutex.c +++ b/libs/libc/misc/lib_mutex.c @@ -241,7 +241,6 @@ int nxmutex_trylock(FAR mutex_t *mutex) { int ret; - DEBUGASSERT(!nxmutex_is_hold(mutex)); ret = nxsem_trywait(&mutex->sem); if (ret < 0) {