Explorar el Código

* WebAssembly threads: fix threadvars with the new WASI-threads implementation

Nikolay Nikolov hace 11 meses
padre
commit
801f902efe
Se han modificado 1 ficheros con 2 adiciones y 6 borrados
  1. 2 6
      rtl/wasi/systhrd.inc

+ 2 - 6
rtl/wasi/systhrd.inc

@@ -336,6 +336,8 @@ procedure WasiAllocateThreadVars; forward;
 procedure FPCWasmThreadStartPascal(tid: longint; start_arg: PWasmThread);
 begin
   {$IFDEF DEBUGWASMTHREADS}DebugWriteln('FPCWasmThreadStartPascal(...)');{$ENDIF}
+  fpc_wasm32_init_tls(start_arg^.InitTLSBase);
+
   start_arg^.ID:=tid;
   GlobalCurrentThread:=@start_arg;
   GlobalIsMainThread:=0;
@@ -359,12 +361,6 @@ asm
   i32.load
   global.set $__stack_pointer
 
-  local.get 1
-  i32.const 4
-  i32.add
-  i32.load
-  global.set $__tls_base
-
   local.get 0
   local.get 1
   call $FPCWasmThreadStartPascal