TDME2 1.9.121
|
Simple server worker thread pool class. More...
#include <tdme/network/udpserver/ServerWorkerThreadPool.h>
Public Member Functions | |
ServerWorkerThreadPool (Barrier *startUpBarrier, const unsigned int workerCount, const unsigned int maxElements) | |
Public constructor. More... | |
virtual | ~ServerWorkerThreadPool () |
Public destructor. More... | |
void | start () |
Start worker thread pool. More... | |
void | stop () |
Stop worker thread pool. More... | |
![]() | |
Queue (const unsigned int maxElements) | |
Public constructor. More... | |
virtual | ~Queue () |
Destructor, removes remaining elements from queue. More... | |
void | stop () |
Requests this queue to be stopped, any gets will be woke up and return NULL. More... | |
ServerRequest * | getElement () |
Gets an element from this queue, if no element exists yet the calling thread will be blocked until an element is available. More... | |
bool | addElement (ServerRequest *element, const bool declinable) |
Adds an element to this queue, signals threads which waits for an element. More... | |
Private Attributes | |
Barrier * | startUpBarrier |
unsigned int | workerCount |
ServerWorkerThread ** | worker |
Friends | |
class | ServerWorkerThread |
Additional Inherited Members | |
![]() | |
typedef queue< ServerRequest * > | QueueType |
![]() | |
QueueType | data |
unsigned int | maxElements |
Simple server worker thread pool class.
Definition at line 23 of file ServerWorkerThreadPool.h.
ServerWorkerThreadPool | ( | Barrier * | startUpBarrier, |
const unsigned int | workerCount, | ||
const unsigned int | maxElements | ||
) |
Public constructor.
startUpBarrier | start up barrier |
workerCount | worker count |
maxElements | max elements |
Definition at line 10 of file ServerWorkerThreadPool.cpp.
|
virtual |
Public destructor.
Definition at line 19 of file ServerWorkerThreadPool.cpp.
void start | ( | ) |
Start worker thread pool.
Definition at line 22 of file ServerWorkerThreadPool.cpp.
void stop | ( | ) |
Stop worker thread pool.
Definition at line 30 of file ServerWorkerThreadPool.cpp.
|
friend |
Definition at line 24 of file ServerWorkerThreadPool.h.
|
private |
Definition at line 51 of file ServerWorkerThreadPool.h.
|
private |
Definition at line 53 of file ServerWorkerThreadPool.h.
|
private |
Definition at line 52 of file ServerWorkerThreadPool.h.