System.Threading.TThreadPool.QueueWorkItem
Delphi
procedure QueueWorkItem(Sender: TObject; WorkerEvent: TNotifyEvent; const AControlFlag: IControlFlag = nil); overload;
procedure QueueWorkItem(const WorkerEvent: TProc; const AControlFlag: IControlFlag = nil); overload;
C++
void __fastcall QueueWorkItem(System::TObject* Sender, System::Classes::TNotifyEvent WorkerEvent, const _di_IControlFlag AControlFlag = _di_IControlFlag())/* overload */;
void __fastcall QueueWorkItem(const System::Sysutils::_di_TProc WorkerEvent, const _di_IControlFlag AControlFlag = _di_IControlFlag())/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Threading.pas System.Threading.hpp |
System.Threading | TThreadPool |
Description
QueueWorkItem queues a procedure until CPU and thread resources are available for execution.
Call the first overloaded QueueWorkItem method with the parameters described below:
Parameter | Meaning |
Sender
|
An object containing data to be used by the event. |
WorkEvent
|
The worker event associated to the task to be executed. |
AControlFlag
|
A flag for the management of worker data execution in the pool. |
Call the second overloaded QueueWorkItem method with the parameters described below:
Parameter | Meaning |
WorkEvent
|
The worker event associated to the task to be executed. |
AControlFlag
|
A flag for the management of worker data execution in the pool. |
Note: If you send
AControlFlag
asnil
value, it will be assigned to-1
.