blocxx
ThreadPool.cpp File Reference
#include "blocxx/BLOCXX_config.h"
#include "blocxx/ThreadPool.hpp"
#include "blocxx/Array.hpp"
#include "blocxx/Thread.hpp"
#include "blocxx/NonRecursiveMutex.hpp"
#include "blocxx/NonRecursiveMutexLock.hpp"
#include "blocxx/Condition.hpp"
#include "blocxx/Format.hpp"
#include "blocxx/Mutex.hpp"
#include "blocxx/MutexLock.hpp"
#include "blocxx/NullLogger.hpp"
#include "blocxx/Timeout.hpp"
#include "blocxx/TimeoutTimer.hpp"
#include "blocxx/GlobalString.hpp"
#include <deque>

Go to the source code of this file.

Classes

class  BLOCXX_NAMESPACE::ThreadPoolImpl
 

Namespaces

namespace  BLOCXX_NAMESPACE
 Taken from RFC 1321.
 

Macros

#define BLOCXX_POOL_LOG_DEBUG(logger, arg)
 
#define BLOCXX_POOL_LOG_DEBUG2(logger, arg)
 
#define BLOCXX_POOL_LOG_DEBUG3(logger, arg)
 
#define BLOCXX_POOL_LOG_ERROR(logger, arg)
 
#define BLOCXX_POOL_LOG_FATAL_ERROR(logger, arg)
 

Macro Definition Documentation

◆ BLOCXX_POOL_LOG_DEBUG

#define BLOCXX_POOL_LOG_DEBUG ( logger,
arg )
Value:
do { BLOCXX_LOG_DEBUG(logger, m_poolName + ": " + arg); } while (0)
#define BLOCXX_LOG_DEBUG(logger, message)
Log message to logger with the Debug level.
Definition Logger.hpp:381
String m_poolName

Definition at line 65 of file ThreadPool.cpp.

◆ BLOCXX_POOL_LOG_DEBUG2

#define BLOCXX_POOL_LOG_DEBUG2 ( logger,
arg )
Value:
do { BLOCXX_LOG_DEBUG2(logger, m_poolName + ": " + arg); } while (0)
#define BLOCXX_LOG_DEBUG2(logger, message)
Log message to logger with the Debug2 level.
Definition Logger.hpp:363

Definition at line 66 of file ThreadPool.cpp.

◆ BLOCXX_POOL_LOG_DEBUG3

#define BLOCXX_POOL_LOG_DEBUG3 ( logger,
arg )
Value:
do { BLOCXX_LOG_DEBUG3(logger, m_poolName + ": " + arg); } while (0)
#define BLOCXX_LOG_DEBUG3(logger, message)
Log message to logger with the Debug3 level.
Definition Logger.hpp:345

Definition at line 67 of file ThreadPool.cpp.

◆ BLOCXX_POOL_LOG_ERROR

#define BLOCXX_POOL_LOG_ERROR ( logger,
arg )
Value:
do { BLOCXX_LOG_ERROR(logger, m_poolName + ": " + arg); } while (0)
#define BLOCXX_LOG_ERROR(logger, message)
Log message to logger with the Error level.
Definition Logger.hpp:433

Definition at line 68 of file ThreadPool.cpp.

◆ BLOCXX_POOL_LOG_FATAL_ERROR

#define BLOCXX_POOL_LOG_FATAL_ERROR ( logger,
arg )
Value:
do { BLOCXX_LOG_FATAL_ERROR(logger, m_poolName + ": " + arg); } while (0)
#define BLOCXX_LOG_FATAL_ERROR(logger, message)
Log message to logger with the FatalError level.
Definition Logger.hpp:450

Definition at line 69 of file ThreadPool.cpp.

Variable Documentation

◆ m_currentRunnable

RunnableRef m_currentRunnable
private

Definition at line 127 of file ThreadPool.cpp.

◆ m_guard

◆ m_logger

Logger m_logger
protected

Definition at line 348 of file ThreadPool.cpp.

◆ m_maxQueueSize

UInt32 m_maxQueueSize
protected

Definition at line 337 of file ThreadPool.cpp.

◆ m_maxThreads

UInt32 m_maxThreads
private

Definition at line 684 of file ThreadPool.cpp.

◆ m_poolName

String m_poolName
protected

Definition at line 349 of file ThreadPool.cpp.

◆ m_queue

std::deque<RunnableRef> m_queue
protected

Definition at line 340 of file ThreadPool.cpp.

◆ m_queueClosed

bool m_queueClosed
protected

Definition at line 341 of file ThreadPool.cpp.

◆ m_queueEmpty

Condition m_queueEmpty
protected

Definition at line 346 of file ThreadPool.cpp.

◆ m_queueLock

NonRecursiveMutex m_queueLock
protected

Definition at line 344 of file ThreadPool.cpp.

◆ m_queueNotEmpty

Condition m_queueNotEmpty
protected

Definition at line 347 of file ThreadPool.cpp.

◆ m_queueNotFull

Condition m_queueNotFull
protected

Definition at line 345 of file ThreadPool.cpp.

◆ m_shutdown

bool m_shutdown
protected

Definition at line 342 of file ThreadPool.cpp.

◆ m_thePool

DynamicSizePoolImpl* m_thePool
private

Definition at line 124 of file ThreadPool.cpp.

◆ m_threads

Array<ThreadRef> m_threads
protected

Definition at line 339 of file ThreadPool.cpp.

◆ m_workingThreads

size_t m_workingThreads
private

Definition at line 750 of file ThreadPool.cpp.