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
@ -241,7 +241,6 @@ int nxmutex_trylock(FAR mutex_t *mutex)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
DEBUGASSERT(!nxmutex_is_hold(mutex));
|
|
||||||
ret = nxsem_trywait(&mutex->sem);
|
ret = nxsem_trywait(&mutex->sem);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user