# PThreadPoolBase Class Reference

Base class for thread pools. More...

`#include <threadpool.h>`

Inheritance diagram for PThreadPoolBase:

List of all members.

## Public Member Functions

| ~PThreadPoolBase ()
virtual WorkerThreadBase * | CreateWorkerThread ()=0
virtual WorkerThreadBase * | AllocateWorker ()
virtual WorkerThreadBase * | NewWorker ()
unsigned | GetMaxWorkers () const
void | SetMaxWorkers (unsigned count)
unsigned | GetMaxUnits () const
void | SetMaxUnits (unsigned count)

## Protected Types

typedef std::vector< WorkerThreadBase * > | WorkerList_t

## Protected Member Functions

| PThreadPoolBase (unsigned maxWorkerCount=10, unsigned maxWorkUnitCount=0)
virtual bool | CheckWorker (WorkerThreadBase *worker)
void | StopWorker (WorkerThreadBase *worker)

## Protected Attributes

PMutex | m_listMutex
WorkerList_t | m_workers
unsigned | m_maxWorkerCount
unsigned | m_maxWorkUnitCount

## Classes

class | InternalWorkBase
class | WorkerThreadBase

## Detailed Description

Base class for thread pools.

## Member Typedef Documentation

typedef std::vector<WorkerThreadBase *> PThreadPoolBase::WorkerList_t `[protected]`

## Constructor & Destructor Documentation

PThreadPoolBase::~PThreadPoolBase | ( |  | ) |

PThreadPoolBase::PThreadPoolBase | ( | unsigned | maxWorkerCount = `10`,
|  | unsigned | maxWorkUnitCount = `0` |
| ) |  |  | `[protected]`

## Member Function Documentation

virtual WorkerThreadBase* PThreadPoolBase::AllocateWorker | ( |  | ) | `[virtual]`

virtual bool PThreadPoolBase::CheckWorker | ( | WorkerThreadBase * | worker | ) | `[protected, virtual]`

virtual WorkerThreadBase* PThreadPoolBase::CreateWorkerThread | ( |  | ) | `[pure virtual]`

Implemented in PQueuedThreadPool< Work_T >.

unsigned PThreadPoolBase::GetMaxUnits | ( |  | ) | const`[inline]`

unsigned PThreadPoolBase::GetMaxWorkers | ( |  | ) | const`[inline]`

virtual WorkerThreadBase* PThreadPoolBase::NewWorker | ( |  | ) | `[virtual]`

void PThreadPoolBase::SetMaxUnits | ( | unsigned | count | ) | `[inline]`

void PThreadPoolBase::SetMaxWorkers | ( | unsigned | count | ) | `[inline]`

void PThreadPoolBase::StopWorker | ( | WorkerThreadBase * | worker | ) | `[protected]`

## Member Data Documentation

PMutex PThreadPoolBase::m_listMutex `[protected]`

unsigned PThreadPoolBase::m_maxWorkerCount `[protected]`

unsigned PThreadPoolBase::m_maxWorkUnitCount `[protected]`

WorkerList_t PThreadPoolBase::m_workers `[protected]`

The documentation for this class was generated from the following file:

- threadpool.h