xtd 0.2.0
Loading...
Searching...
No Matches

◆ register_wait_for_single_object() [3/4]

static registered_wait_handle xtd::threading::thread_pool::register_wait_for_single_object ( wait_handle wait_object,
const wait_or_timer_callback callback,
std::any  state,
const time_span timeout,
bool  execute_only_once 
)
static

Registers a delegate to wait for a xtd::threading::wait_handle, specifying a 32-bit signed integer for the time-out in milliseconds.

Parameters
wait_objectThe xtd::threading::wait_handle to register. Use a xtd::threading::wait_handle other than Mutex
callbackA pointer function to call when the wait_object parameter is signaled.
stateThe object that is passed to the callback.
timeoutThe time-out represented by a time_span.If timeout is 0 (zero), the function tests the object's state and returns immediately.If timeout is -1, the function's time-out interval never elapses.
execute_only_oncetrue to indicate that the thread will no longer wait on the wait_object parameter after the callback has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered.
Returns
registered_wait_handle The xtd::threading::registered_wait_handle that encapsulates the native handle.
Exceptions
xtd::argument_out_of_range_exceptionThe milliseconds_timeout_interval parameter is less than -1.