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

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

#include <B2BITS_ThreadsPool.h>

Classes

struct  ThreadInterrupted
 ThreadInterrupted exception. More...
 

Public Member Functions

void interruptAll ()
 Interrupts all threads that are executing this task. More...
 
void interruptOne ()
 Interrupts one thread that is executing this task. More...
 
void join ()
 Waits until all threads finished Runnable::run() More...
 

Protected Member Functions

bool checkIfInterrupted ()
 Returns true if the thread has been interrupted. More...
 
void interruptionCheckpoint ()
 Throws the ThreadInterrupted exception if the thread has been interrupted. More...
 
virtual void run (const ThreadAttrs &threadAttrs)=0
 The task execution method that is run by a thread from the pool. More...
 
 Runnable ()
 Constructor. More...
 
virtual void wake ()
 The optional thread wakening method. More...
 
virtual ~Runnable ()
 Destructor. More...
 

Friends

class ThreadsPool::Impl
 

Detailed Description

The task executed by a thread in the pool.

Constructor & Destructor Documentation

Utils::ThreadsPool::Runnable::Runnable ( )
protected

Constructor.

virtual Utils::ThreadsPool::Runnable::~Runnable ( )
protectedvirtual

Destructor.

Member Function Documentation

bool Utils::ThreadsPool::Runnable::checkIfInterrupted ( )
protected

Returns true if the thread has been interrupted.

Note
A thread must not call methods interruptionCheckpoint() and checkIfInterrupted() once the interruption signal is received.
void Utils::ThreadsPool::Runnable::interruptAll ( )

Interrupts all threads that are executing this task.

void Utils::ThreadsPool::Runnable::interruptionCheckpoint ( )
protected

Throws the ThreadInterrupted exception if the thread has been interrupted.

Note
A thread must not call methods interruptionCheckpoint() and checkIfInterrupted() once the interruption signal is received.
Exceptions
TheThreadInterrupted exception
void Utils::ThreadsPool::Runnable::interruptOne ( )

Interrupts one thread that is executing this task.

void Utils::ThreadsPool::Runnable::join ( )

Waits until all threads finished Runnable::run()

virtual void Utils::ThreadsPool::Runnable::run ( const ThreadAttrs threadAttrs)
protectedpure virtual

The task execution method that is run by a thread from the pool.

Parameters
threadAttrsthread attributes applied to the thread that is executing this task.
virtual void Utils::ThreadsPool::Runnable::wake ( )
protectedvirtual

The optional thread wakening method.

It is called by the ThreadsPool to wake the thread sleeping inside the run()

Friends And Related Function Documentation

friend class ThreadsPool::Impl
friend