Threads share the parent process's Memory. This function:
Instantiates the same Wasm module with shared memory (start section stripped)
Allocates TLS for the thread
Sets the channel base and stack pointer
Calls the thread function via the indirect function table
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.
Thread worker entry point.
Threads share the parent process's Memory. This function:
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.