CWorkerThread Class
This class creates a worker thread or uses an existing one, waits on one or more kernel object handles, and executes a specified client function when one of the handles is signaled.
template <
class ThreadTraits = DefaultThreadTraits
>
class CWorkerThread
Параметры
- ThreadTraits
The class providing the thread creation function, such as CRTThreadTraits or Win32ThreadTraits.
Заметки
To use CWorkerThread
Create an instance of this class.
Call CWorkerThread::AddHandle with the handle of a kernel object and a pointer to an implementation of IWorkerThreadClient.
– or –
Call CWorkerThread::AddTimer with a pointer to an implementation of IWorkerThreadClient.
Implement IWorkerThreadClient::Execute to take some action when the handle or timer is signaled.
To remove an object from the list of waitable objects, call CWorkerThread::RemoveHandle.
To terminate the thread, call CWorkerThread::Shutdown.
Требования
Header: atlutil.h