* WebAssembly threads: reformat code in LockMutexTimeoutNoWait for better

readability by removing begin..end blocks and replacing it with an 'else if'
  chain. No functional changes.
This commit is contained in:
Nikolay Nikolov 2024-08-04 00:33:39 +03:00
parent cc2406ad74
commit c2fcb1a833

View File

@ -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;