Browse Source

+ WebAssembly threads: initialize the ThreadId threadvar for the main thread

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

+ 1 - 0
rtl/wasi/systhrd.inc

@@ -132,6 +132,7 @@ begin
   GlobalIsMainThread:=1;
   GlobalIsWorkerThread:=0;
   GlobalCurrentThread:=@MainThread;
+  ThreadId:=@MainThread;
 {$IFDEF FPC_WASM_MAIN_THREAD_CAN_WAIT}
   GlobalIsThreadBlockable:=1;
 {$ELSE FPC_WASM_MAIN_THREAD_CAN_WAIT}