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

◆ wait_or_timer_callback

using xtd::threading::wait_or_timer_callback = typedef delegate<void(std::any, bool)>

Represents a method to be called when a xtd::threading::wait_handle is signaled or times out.

delegate< void(arguments_t...)> action
Represents a xtd::delegate that has variable parameters and does not return a value.
Definition action.h:20
delegate< void(std::any, bool)> wait_or_timer_callback
Represents a method to be called when a xtd::threading::wait_handle is signaled or times out.
Definition wait_or_timer_callback.h:30
Header
#include <xtd/threading/wait_or_timer_callback>
Namespace
xtd::threading
Library
xtd.core
Parameters
stateAn object containing information to be used by the callback method each time it executes.
timed_outtrue if the xtd::threading::wait_handle timed out; false if it was signaled.
Remarks
xtd::threading::wait_or_timer_callback represents a callback method that you want to execute when a registered wait handle times out or is signaled. Create the delegate by passing your callback method to the xtd::threading::wait_or_timer_callback constructor. Your method must have the signature shown here.
Create the registered wait handle by passing the xtd::threading::wait_or_timer_callback delegate and a xtd::threading::wait_handle to xtd::threading::thread_pool::register_wait_for_single_object. Your callback method executes each time the xtd::threading::wait_handle times out or is signaled.
If you want to pass information to your callback method, create an object that contains the necessary information and pass it to xtd::threading::thread_pool::register_wait_for_single_object when you create the registered wait handle. Each time your callback method executes, the state parameter contains this object.