Fix TestThread.c and POSIX semaphore

This commit is contained in:
2025-08-28 17:28:07 +03:00
parent 377247bbe1
commit 12a00c3515
2 changed files with 6 additions and 4 deletions

View File

@@ -64,9 +64,11 @@ int BH_SemaphoreWaitFor(BH_Semaphore *semaphore,
if (convertToTimespec(&ts, timeout))
return BH_ERROR;
switch (sem_timedwait(&semaphore->handle, &ts))
if (!sem_timedwait(&semaphore->handle, &ts))
return BH_OK;
switch (errno)
{
case 0: return BH_OK;
case ETIMEDOUT: return BH_TIMEOUT;
default: return BH_ERROR;
}