From c2fcb1a8336cb9b40a43667c6489ebca7081da14 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 4 Aug 2024 00:33:39 +0300 Subject: [PATCH] * 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. --- rtl/wasi/wasmmutex.inc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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;