Represents a method to be called when a System.Threading.WaitHandle is signaled or times out.
- state
- Documentation for this section has not yet been entered.
- timedOut
- Documentation for this section has not yet been entered.
System.Threading.WaitOrTimerCallback 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 System.Threading.WaitOrTimerCallback constructor. Your method must have the signature shown here.
Create the registered wait handle by passing the System.Threading.WaitOrTimerCallback delegate and a System.Threading.WaitHandle to ThreadPool.RegisterWaitForSingleObject(WaitHandle, WaitOrTimerCallback, object, uint, bool). Your callback method executes each time the System.Threading.WaitHandle times out or is signaled.
[Visual Basic]
Visual Basic users can omit the System.Threading.WaitOrTimerCallback constructor, and simply use the AddressOf operator when passing the callback method to ThreadPool.RegisterWaitForSingleObject(WaitHandle, WaitOrTimerCallback, object, uint, bool). Visual Basic automatically calls the correct delegate constructor.
If you want to pass information to your callback method, create an object that contains the necessary information and pass it to ThreadPool.RegisterWaitForSingleObject(WaitHandle, WaitOrTimerCallback, object, uint, bool) when you create the registered wait handle. Each time your callback method executes, the state parameter contains this object.
For more information about using callback methods to synchronize thread pool threads, see [<topic://cpconthreadpooling>].