Browse Source

+ WebAssembly threads: set FThreadReaped to true in TThread.WaitFor, to avoid
hang in TThread.SysDestroy after .WaitFor

Nikolay Nikolov 1 year ago
parent
commit
df26a02d9d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      rtl/wasi/tthread.inc

+ 3 - 0
rtl/wasi/tthread.inc

@@ -217,6 +217,9 @@ function TThread.WaitFor: Integer;
 
 begin
   WaitFor:=WaitForThreadTerminate(FThreadID,-1);
+  { should actually check for errors in WaitForThreadTerminate, but no }
+  { error api is defined for that function                             }
+  FThreadReaped:=true;
 end;
 
 {$else FPC_WASM_THREADS}