Browse Source

+ WebAssembly threads: initialize TWasmThread.ThreadHasFinished to false in WasiBeginThread

Nikolay Nikolov 11 months ago
parent
commit
7fe6438d44
1 changed files with 1 additions and 0 deletions
  1. 1 0
      rtl/wasi/systhrd.inc

+ 1 - 0
rtl/wasi/systhrd.inc

@@ -490,6 +490,7 @@ begin
   {$IFDEF DEBUGWASMTHREADS}DebugWriteln('WasiBeginThread(sa: '+IntToStr(PtrUint(Sa))+',ss: '+IntToStr(PtrUint(StackSize))+',TF: '+IntToStr(PtrUint(ThreadFunction))+',Arg: '+IntToStr(PtrUint(P))+',fl: '+IntToStr(PtrUint(CreationFlags))+',ID: '+IntToStr(PtrUint(ThreadID))+')');{$ENDIF}
   IsMultiThread:=true;
   New(T);
+  fpc_wasm32_i32_atomic_store8(@T^.ThreadHasFinished,0);
   T^.StackBlock:=nil;
   T^.TLSBlock:=nil;
   ThreadID:=T;