libc: nxmutex_clocklock abstime supports NULL pointer

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2024-06-27 16:30:23 +08:00 committed by Xiang Xiao
parent 01864d262c
commit eee7cb6efa

View File

@ -303,7 +303,14 @@ int nxmutex_clocklock(FAR mutex_t *mutex, clockid_t clockid,
do
{
ret = nxsem_clockwait(&mutex->sem, clockid, abstime);
if (abstime)
{
ret = nxsem_clockwait(&mutex->sem, clockid, abstime);
}
else
{
ret = nxsem_wait(&mutex->sem);
}
}
while (ret == -EINTR || ret == -ECANCELED);