Apache Log4cxx  Version 1.2.0
Loading...
Searching...
No Matches
log4cxx::helpers::ThreadUtility Class Reference

#include <threadutility.h>

Public Member Functions

 ~ThreadUtility ()
 
void configureFuncs (ThreadStartPre pre_start, ThreadStarted started, ThreadStartPost post_start)
 Configure the thread functions that log4cxx will use.
 
void preThreadBlockSignals ()
 A pre-start thread function that blocks signals to the new thread (if the system has pthreads).
 
void threadStartedNameThread (LogString threadName, std::thread::id thread_id, std::thread::native_handle_type native_handle)
 A thread_started function that names the thread using the appropriate system call.
 
void postThreadUnblockSignals ()
 A post-start thread function that unblocks signals that preThreadBlockSignals blocked before starting the thread.
 
template<class Function , class... Args>
std::thread createThread (LogString name, Function &&f, Args &&... args)
 Start a thread.
 

Static Public Member Functions

static ThreadUtilityinstance ()
 
static void configure (ThreadConfigurationType type)
 Utility method for configuring the ThreadUtility in a standard configuration.
 

Friends

class log4cxx::helpers::WideLife< ThreadUtility >
 

Constructor & Destructor Documentation

◆ ~ThreadUtility()

log4cxx::helpers::ThreadUtility::~ThreadUtility ( )

Member Function Documentation

◆ configure()

static void log4cxx::helpers::ThreadUtility::configure ( ThreadConfigurationType  type)
static

Utility method for configuring the ThreadUtility in a standard configuration.

◆ configureFuncs()

void log4cxx::helpers::ThreadUtility::configureFuncs ( ThreadStartPre  pre_start,
ThreadStarted  started,
ThreadStartPost  post_start 
)

Configure the thread functions that log4cxx will use.

Note that setting any of these parameters to nullptr is valid, and simply results in the callback not being called.

◆ createThread()

template<class Function , class... Args>
std::thread log4cxx::helpers::ThreadUtility::createThread ( LogString  name,
Function &&  f,
Args &&...  args 
)
inline

Start a thread.

◆ instance()

static ThreadUtility * log4cxx::helpers::ThreadUtility::instance ( )
static

◆ postThreadUnblockSignals()

void log4cxx::helpers::ThreadUtility::postThreadUnblockSignals ( )

A post-start thread function that unblocks signals that preThreadBlockSignals blocked before starting the thread.

If the system does not have pthreads, does nothing.

◆ preThreadBlockSignals()

void log4cxx::helpers::ThreadUtility::preThreadBlockSignals ( )

A pre-start thread function that blocks signals to the new thread (if the system has pthreads).

If the system does not have pthreads, does nothing.

◆ threadStartedNameThread()

void log4cxx::helpers::ThreadUtility::threadStartedNameThread ( LogString  threadName,
std::thread::id  thread_id,
std::thread::native_handle_type  native_handle 
)

A thread_started function that names the thread using the appropriate system call.

Friends And Related Function Documentation

◆ log4cxx::helpers::WideLife< ThreadUtility >

friend class log4cxx::helpers::WideLife< ThreadUtility >
friend

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