API:System.Threading.TFuture.Create

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

constructor Create(Sender: TObject; Event: TFunctionEvent<T>; const Func: TFunc<T>; APool: TThreadPool); overload;

Properties

Type Visibility Source Unit Parent
constructor protected System.Threading.pas System.Threading TFuture

Description

Creates an instance of TTask managing the execution of a procedure that may execute in a parallel thread.

System.Threading.TFuture.Create inherits from System.Threading.TTask.Create. All content below this line refers to System.Threading.TTask.Create.

Creates an instance of TTask managing the execution of a procedure that may execute in a parallel thread.

Create is used when directly constructing instances of TTask. Since instances of TTask only operate on procedures suitable to execute in parallel threads, one should not call the constructor without parameters for this type.

Create may be created specifying either a TProc or a TNotifyEvent to designate the procedure suitable to run in a parallel thread. In the case of a TNotifyEvent procedure, a Sender object is provided which is passed along to the parallel procedure when executed.

If desired, Create can also be given a parameter of TThreadPool from which the instance of TTask may draw the thread resources it needs. Without specifying an instance of TThreadPool, resources are drawn from a default based upon the CPU and threading capabilities of the platform.

See Also