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 <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2024-05-05 11:28:49 +08:00 committed by Xiang Xiao
parent 53ddc3ef7f
commit 4af6db7c80

View File

@ -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)
{