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

@ -302,9 +302,16 @@ int nxmutex_clocklock(FAR mutex_t *mutex, clockid_t clockid,
/* Wait until we get the lock or until the timeout expires */
do
{
if (abstime)
{
ret = nxsem_clockwait(&mutex->sem, clockid, abstime);
}
else
{
ret = nxsem_wait(&mutex->sem);
}
}
while (ret == -EINTR || ret == -ECANCELED);
if (ret >= 0)