wasm-posix-host
    Preparing search index...

    Function centralizedThreadWorkerMain

    • Thread worker entry point.

      Threads share the parent process's Memory. This function:

      1. Instantiates the same Wasm module with shared memory (start section stripped)
      2. Allocates TLS for the thread
      3. Sets the channel base and stack pointer
      4. Calls the thread function via the indirect function table
      5. On return: performs CLONE_CHILD_CLEARTID (write 0 + futex wake at ctidPtr)

      If the thread function calls fork(), this entry point drives the wpk_fork_* unwind/SYS_FORK/rewind loop just like the main process worker, but rooted at the pthread function and this thread's channel-local fork buffer.

      Returns Promise<void>