windows/Thread

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.


Thread

Methods

create (code context stackSize --) Starts one thread from one entry-code pointer, one context value, and one explicit stack size in bytes.

Preconditions

  • The wrapper is not already running.

Postconditions

  • The wrapper becomes handle-owning.
isRunning (-- running) Reports whether the wrapper still owns a thread handle that has not yet been closed by wait or destruction.
wait (-- exitCode) Waits for thread completion, closes the thread handle, and returns the thread exit code as Nat32.

Preconditions

  • The wrapper is running.

Postconditions

  • The wrapper is no longer running.

Helper constructor

toThread3 (code context stackSize -- threadRef) Constructs one Thread, starts it immediately through create, and returns Ref to the handle-owning wrapper.

Lifecycle and exit codes


See also