mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:29:14 +02:00
* 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:
parent
cc2406ad74
commit
c2fcb1a833
@ -85,16 +85,10 @@ begin
|
|||||||
Repeat
|
Repeat
|
||||||
if TryLockMutex(M) then
|
if TryLockMutex(M) then
|
||||||
Result:=lmrOK
|
Result:=lmrOK
|
||||||
else
|
else if (GetThreadState(MyThread)<>tsRunning) then
|
||||||
begin
|
Res:=lmrError
|
||||||
If (GetThreadState(MyThread)<>tsRunning) then
|
else if (aTimeOutNS>=0) and (GetClockTime>EndTime) then
|
||||||
Res:=lmrError
|
Res:=lmrTimeOut;
|
||||||
else
|
|
||||||
begin
|
|
||||||
If (aTimeOutNS>=0) and (GetClockTime>EndTime) then
|
|
||||||
Res:=lmrTimeOut
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
Until (res<>lmrNone);
|
Until (res<>lmrNone);
|
||||||
{$IFDEF DEBUGWASMTHREADS}DebugWriteln('LockMutexTimeoutNoWait: done loop');{$ENDIF}
|
{$IFDEF DEBUGWASMTHREADS}DebugWriteln('LockMutexTimeoutNoWait: done loop');{$ENDIF}
|
||||||
LockMutexTimeoutNoWait:=Res;
|
LockMutexTimeoutNoWait:=Res;
|
||||||
|
Loading…
Reference in New Issue
Block a user