diff --git a/rtl/wasi/wasmmutex.inc b/rtl/wasi/wasmmutex.inc index 0e2d8b744c..a3043b4c64 100644 --- a/rtl/wasi/wasmmutex.inc +++ b/rtl/wasi/wasmmutex.inc @@ -85,16 +85,10 @@ begin Repeat if TryLockMutex(M) then Result:=lmrOK - else - begin - If (GetThreadState(MyThread)<>tsRunning) then - Res:=lmrError - else - begin - If (aTimeOutNS>=0) and (GetClockTime>EndTime) then - Res:=lmrTimeOut - end; - end; + else if (GetThreadState(MyThread)<>tsRunning) then + Res:=lmrError + else if (aTimeOutNS>=0) and (GetClockTime>EndTime) then + Res:=lmrTimeOut; Until (res<>lmrNone); {$IFDEF DEBUGWASMTHREADS}DebugWriteln('LockMutexTimeoutNoWait: done loop');{$ENDIF} LockMutexTimeoutNoWait:=Res;