소스 검색

* 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 년 전
부모
커밋
694341aa78
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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}
   {$IFDEF DEBUGWASMTHREADS}DebugWriteln('LockMutexTimeoutNoWait: entering loop');{$ENDIF}
   Repeat
   Repeat
     if TryLockMutex(M) then
     if TryLockMutex(M) then
-      Result:=lmrOK
+      Res:=lmrOK
     else if (GetThreadState(MyThread)<>tsRunning) then
     else if (GetThreadState(MyThread)<>tsRunning) then
       Res:=lmrError
       Res:=lmrError
     else if (aTimeOutNS>=0) and (GetClockTime>EndTime) then
     else if (aTimeOutNS>=0) and (GetClockTime>EndTime) then