Raw operating-system-thread wrapper with explicit creation, handle-state checks, and completion waiting. The wrapper owns one operating-system thread handle and returns one Nat32 exit code from wait.
create |
(code context stackSize --) |
Starts one thread from one entry-code pointer, one context value, and one explicit stack size in bytes. |
Thread is not running.create starts the thread and stores the resulting handle in the wrapper.isRunning reports handle ownership, not whether the operating-system thread is still executing instructions at that moment.wait blocks until completion, returns the thread exit code, closes the owned handle, and leaves the wrapper not running.Nat32 exit code, and wait returns that same value.Thread waits for completion and discards the exit code.