CComSimpleThreadAllocator

class CComSimpleThreadAllocator

CComSimpleThreadAllocator can be used to manage thread selection for CComAutoThreadModule. CComSimpleThreadAllocator::GetThread simply cycles through each thread and returns the next one in the sequence.

#include <atlbase.h>

See Also CComApartment


CComSimpleThreadAllocator Class Members

Methods
GetThreadSelects a thread.

CComSimpleThreadAllocator Overview


Methods


CComSimpleThreadAllocator::GetThread

int GetThread( CComApartment* pApt, int nThreads );

Return Value

An integer between zero and nThreads – 1. Identifies one of the threads in the EXE module.

Parameters

pApt [in] Not used in ATL's default implementation.

nThreads [in] The maximum number of threads in the EXE module.

Remarks

Selects a thread by specifying the next thread in the sequence. 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.

CComSimpleThreadAllocator Overview | Class Members

See Also CComApartment