RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
THandleObject.WaitForMultiple Method

Waits until a list of THandleObject objects enters into the signaled state.

Pascal
class function WaitForMultiple(const HandleObjs: THandleObjectArray; Timeout: LongWord; AAll: Boolean; out SignaledObj: THandleObject; UseCOMWait: Boolean = False; Len: Integer = 0): TWaitResult;
C++
__fastcall TWaitResult WaitForMultiple(const THandleObjectArray HandleObjs, LongWord Timeout, Boolean AAll, THandleObject SignaledObj, Boolean UseCOMWait = False, int Len = 0);

Call WaitForMultiple to wait until a list of THandleObject objects enters into the signaled state. If the signaled state is not reached after TimeOut milliseconds, WaitForMultiple returns anyway.  

The HandleObjs parameter contains the list of objects that are waited on.  

If the AAll parameter is true, the call will finish only after all objects become signaled.  

The first signaled object is passed into the SignaledObj parameter. This only happens if the function returns wrSignaled and AAll is False.  

Set the UseCOMWait parameter to ensure that when a thread is blocked and waiting for the object, any STA COM calls can be made back into this thread.  

Len contains the number of objects that are monitored in the given list.  

The function returns a result of TWaitResult type, which can be used to detect how the operation finished. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!