B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Friends | List of all members
Utils::ThreadsPool Class Reference

The pool of threads. More...

#include <B2BITS_ThreadsPool.h>

+ Inheritance diagram for Utils::ThreadsPool:

Classes

class  Runnable
 The task executed by a thread in the pool. More...
 

Public Types

typedef ThreadsPoolListener Listener
 

Public Member Functions

void goThroughThreads ()
 Goes through all active threads. More...
 
void interruptAll ()
 Interrupts all active threads. More...
 
void joinAll ()
 Joins all active threads. More...
 
void newThread (Runnable *runnable, const ThreadAttrs &threadAttrs)
 Adds a new thread to the pool to execute runnable task. More...
 
void notifyNewThreadAssigned (ThreadAttrs &threadAttrs)
 Calls ThreadsPoolListener::onNewThreadCreated(threadAttrs) for all listeners. More...
 
void registerListener (Listener *listener)
 Registers a new thread pool listener. More...
 
 ThreadsPool ()
 Constructor. More...
 
void unregisterListener (Listener *listener)
 Registers the thread pool listener. More...
 
 ~ThreadsPool ()
 Destructor. More...
 

Friends

struct BlackDoor
 

Detailed Description

The pool of threads.

Member Typedef Documentation

Constructor & Destructor Documentation

Utils::ThreadsPool::ThreadsPool ( )

Constructor.

Utils::ThreadsPool::~ThreadsPool ( )

Destructor.

Member Function Documentation

void Utils::ThreadsPool::goThroughThreads ( )

Goes through all active threads.

See Also
ThreadsPoolListener::onGoThroughThreads(threadAttrs)
void Utils::ThreadsPool::interruptAll ( )

Interrupts all active threads.

void Utils::ThreadsPool::joinAll ( )

Joins all active threads.

void Utils::ThreadsPool::newThread ( Runnable runnable,
const ThreadAttrs threadAttrs 
)

Adds a new thread to the pool to execute runnable task.

Parameters
runnableThe task to run. Must exist until the thread is finished e.g. until joinAll() returns.
threadAttrsThe thread attributes to apply to the new thread.
void Utils::ThreadsPool::notifyNewThreadAssigned ( ThreadAttrs threadAttrs)

Calls ThreadsPoolListener::onNewThreadCreated(threadAttrs) for all listeners.

Parameters
[in,out]threadAttrsthread attributes to pass to listeners
See Also
ThreadsPoolListener::onNewThreadCreated(threadAttrs)
void Utils::ThreadsPool::registerListener ( Listener listener)

Registers a new thread pool listener.

void Utils::ThreadsPool::unregisterListener ( Listener listener)

Registers the thread pool listener.

Must not be called from the Listener callback.

Friends And Related Function Documentation

friend struct BlackDoor
friend