* 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!
This commit is contained in:
Nikolay Nikolov 2024-08-04 00:35:17 +03:00
parent c2fcb1a833
commit 694341aa78

View File

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