| description | Learn more about: CComSimpleThreadAllocator Class | ||||
|---|---|---|---|---|---|
| title | CComSimpleThreadAllocator Class | ||||
| ms.date | 11/04/2016 | ||||
| f1_keywords |
|
||||
| helpviewer_keywords |
|
||||
| ms.assetid | 66b2166a-8c50-49fd-b8e4-7f293470327d |
This class manages thread selection for the class CComAutoThreadModule.
class CComSimpleThreadAllocator
| Name | Description |
|---|---|
| CComSimpleThreadAllocator::GetThread | Selects a thread. |
CComSimpleThreadAllocator manages thread selection for CComAutoThreadModule. CComSimpleThreadAllocator::GetThread simply cycles through each thread and returns the next one in the sequence.
Header: atlbase.h
Selects a thread by specifying the next thread in the sequence.
int GetThread(CComApartment* /* pApt */, int nThreads);
pApt
Not used in ATL's default implementation.
nThreads
The maximum number of threads in the EXE module.
An integer between zero and (nThreads - 1). Identifies one of the threads in the EXE module.
You can override GetThread to provide a different method of selection or to make use of the pApt parameter.
GetThread is called by CComAutoThreadModule::CreateInstance.