System.Threading.TThreadPool.IThreadPoolWorkItem
Delphi
IThreadPoolWorkItem = interface(IInterface)
C++
__interface IThreadPoolWorkItem : public System::IInterface
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
interface class |
protected | System.Threading.pas System.Threading.hpp |
System.Threading | TThreadPool |
Description
Interface for workers of the thread pool.
A worker is an object that can perform a task. Classes that implement the IThreadPoolWorkItem interface must implement the following two methods:
- ExecuteWork performs the task of the object when called.
- ShouldExecute returns
True
if the task can be executed, orFalse
if the task should not be executed.
The thread pool always checks the value of ShouldExecute before a call to ExecuteWork.
Examples of classes that implement IThreadPoolWorkItem: TWorkerData, TTask (though ITask), TFuture (through IFuture).