Browse Source

* WebAssembly threads: fixed bug in LockMutexTimeoutNoWait, caused by the use of
Result instead of Res. This stupid bug broke WebAssembly critical sections,
causing random spurious hangs and it took me quite a lot of time to find it!

Nikolay Nikolov 1 year ago
parent
commit
694341aa78
1 changed files with 1 additions and 1 deletions
  1. 1 1
      rtl/wasi/wasmmutex.inc

+ 1 - 1
rtl/wasi/wasmmutex.inc

@@ -84,7 +84,7 @@ begin
   {$IFDEF DEBUGWASMTHREADS}DebugWriteln('LockMutexTimeoutNoWait: entering loop');{$ENDIF}
   Repeat
     if TryLockMutex(M) then
-      Result:=lmrOK
+      Res:=lmrOK
     else if (GetThreadState(MyThread)<>tsRunning) then
       Res:=lmrError
     else if (aTimeOutNS>=0) and (GetClockTime>EndTime) then