Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends

cbThreadPool Class Reference

A Thread Pool implementation. More...

#include <cbthreadpool.h>

List of all members.

Classes

struct  cbThreadedTaskElement
 All tasks are added to one of these. It'll also save the autodelete value. More...
class  cbWorkerThread
class  CountedPtr
 Josuttis' implementation of CountedPtr. More...

Public Member Functions

void AbortAllTasks ()
void AddTask (cbThreadedTask *task, bool autodelete=true)
void BatchBegin ()
void BatchEnd ()
 cbThreadPool (wxEvtHandler *owner, int id=-1, int concurrentThreads=-1)
bool Done () const
int GetConcurrentThreads () const
void SetConcurrentThreads (int concurrentThreads)
 ~cbThreadPool ()
 cbThreadPool dtor

Protected Member Functions

cbThreadedTaskElement GetNextTask ()
void TaskDone (cbWorkerThread *thread)
bool WaitingThread ()
void WorkingThread ()
 Mechanism for the threads to tell the Pool they're running.

Private Types

typedef std::list
< cbThreadedTaskElement
TasksQueue
typedef std::vector
< cbWorkerThread * > 
WorkerThreadsArray

Private Member Functions

void _SetConcurrentThreads (int concurrentThreads)
void AwakeNeeded ()
void Broadcast ()

Private Attributes

bool m_batching
int m_concurrentThreads
int m_concurrentThreadsSchedule
int m_ID
wxMutex m_Mutex
wxEvtHandler * m_pOwner
CountedPtr< wxSemaphore > m_semaphore
TasksQueue m_tasksQueue
WorkerThreadsArray m_threads
int m_workingThreads

Friends

class cbWorkerThread

Detailed Description

A Thread Pool implementation.

Definition at line 35 of file cbthreadpool.h.


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

Generated by  Doxygen 1.6.0   Back to index