Skip to main content

Module wait

Module wait 

Source
Expand description

Thread-pool waits: CreateThreadpoolWait / SetThreadpoolWait / WaitForThreadpoolWaitCallbacks / CloseThreadpoolWait.

A wait object watches one waitable handle and queues its callback when the handle is signalled or the wait times out. Two SDK contracts shape this API:

  • The handle must stay valid while a wait is pending. ThreadpoolWait therefore owns its handle rather than borrowing one, so it cannot be closed underneath a pending wait. Use ThreadpoolWait::handle to signal or inspect it.
  • A wait fires at most once per arming. The SDK requires the wait to be rearmed explicitly for each activation, so the callback receives a WaitActivation carrying WaitActivation::rearm. A callback that does not rearm simply stops watching.

Mutex handles are not supported by the thread pool and must not be passed to ThreadpoolWait::new.

Structs§

ThreadpoolWait
An owned thread-pool wait object bound to one waitable handle.
WaitActivation
One activation of a ThreadpoolWait, handed to its callback.
WaitableHandle
A handle the thread pool is able to wait on.

Enums§

WaitResult
Why a wait callback ran.

Type Aliases§

WaitCloseFn
A Win32 routine that closes a wait target.