Show: Delphi C++
Display Preferences

System.Threading.TTask.WaitForAny

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function WaitForAny(const Tasks: array of ITask): Integer; overload; static;
class function WaitForAny(const Tasks: array of ITask; Timeout: LongWord): Integer; overload; static;
class function WaitForAny(const Tasks: array of ITask; const Timeout: TTimeSpan): Integer; overload; static;

C++

static int __fastcall WaitForAny(const _di_ITask *Tasks, const int Tasks_High)/* overload */;
static int __fastcall WaitForAny(const _di_ITask *Tasks, const int Tasks_High, unsigned Timeout)/* overload */;
static int __fastcall WaitForAny(const _di_ITask *Tasks, const int Tasks_High, const System::Timespan::TTimeSpan &Timeout)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Threading.pas
System.Threading.hpp
System.Threading TTask

Description

WaitForAny calls DoWaitForAny, which waits for any of the tasks in the array to be completed.

The WaitForAny method returns True if it succeeds, False otherwise.

Call the first overloaded WaitForAny method with the parameters described below:

Parameter Meaning
Tasks The calling task waits for any of the tasks contained in this array.

Call the second overloaded WaitForAny method with the parameters described below:

Parameter Meaning
Tasks The calling task waits for any of the tasks contained in this array.
Timeout The method waits a Timeout number of milliseconds to any of the tasks of the array to be completed. If the Timeout occurs before the tasks are completed, the method will return False. This is a LongWord variable type.

Call the third overloaded WaitForAny method with the parameters described below:

Parameter Meaning
Tasks The calling task waits for any of the tasks contained in this array.
Timeout The method waits a Timeout number of milliseconds to any of the tasks of the array to be completed. If the Timeout occurs before the tasks are completed, the method will return False. This is a TTimeSpan variable type and it is converted to milliseconds before calling DoWaitForAny.

See Also

Personal tools
In Other Languages
Previous Versions
Assistance