NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ThreadPool.RegisterWaitForSingleObject (WaitHandle, WaitOrTimerCallback, Object, TimeSpan, Boolean)

Registers an object.

[Visual Basic]
Overloads Public Shared Function RegisterWaitForSingleObject( _
   ByVal waitObject As WaitHandle, _
   ByVal callBack As WaitOrTimerCallback, _
   ByVal state As Object, _
   ByVal timeout As TimeSpan, _
   ByVal executeOnlyOnce As Boolean _
) As RegisteredWaitHandle
[C#]
public static RegisteredWaitHandle RegisterWaitForSingleObject(
   WaitHandle waitObject,
   WaitOrTimerCallback callBack,
   object state,
   TimeSpan timeout,
   bool executeOnlyOnce
);
[C++]
public: static RegisteredWaitHandle* RegisterWaitForSingleObject(
   WaitHandle* waitObject,
   WaitOrTimerCallback* callBack,
   Object* state,
   TimeSpan timeout,
   bool executeOnlyOnce
);
[JScript]
public static function RegisterWaitForSingleObject(
   waitObject : WaitHandle,
   callBack : WaitOrTimerCallback,
   state : Object,
   timeout : TimeSpan,
   executeOnlyOnce : Boolean
) : RegisteredWaitHandle;

Parameters

waitObject
The WaitHandle to register.
callBack
A delegate to call when the handle is signaled.
state
The object that is passed to the delegate when serviced from the thread pool.
timeout
The time-out represented by a TimeSpan.
executeOnlyOnce
The Boolean to determine whether the timer is reset every time the event is signaled or the time-out interval elapses.

Return Value

The RegisteredWaitHandle object that encapsulates the native handle.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException if millisecondsTimeOutInterval is less than-1.
NotSupportedException if millisecondsTimeOutInterval is greater than Int32.MaxValue

See Also

ThreadPool Class | ThreadPool Members | System.Threading Namespace | ThreadPool.RegisterWaitForSingleObject Overload List