mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +08:00
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:
parent
53ddc3ef7f
commit
4af6db7c80
1 changed files with 0 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue