18#ifndef _LOG4CXX_THREADUTILITY_H
19#define _LOG4CXX_THREADUTILITY_H
48typedef std::function<void(
LogString threadName,
49 std::thread::id threadId,
78 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(priv_data, m_priv)
111 std::thread::id thread_id,
112 std::thread::native_handle_type native_handle);
124 template<
class Function,
class... Args>
138 std::thread t( f, args... );
Definition: threadutility.h:70
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.
static ThreadUtility * instance()
std::thread createThread(LogString name, Function &&f, Args &&... args)
Start a thread.
Definition: threadutility.h:125
void postThreadUnblockSignals()
A post-start thread function that unblocks signals that preThreadBlockSignals blocked before starting...
static void configure(ThreadConfigurationType type)
Utility method for configuring the ThreadUtility in a standard configuration.
std::function< void()> ThreadStartPost
Called after a thread has started.
Definition: threadutility.h:56
ThreadConfigurationType
Definition: threadutility.h:59
@ BlockSignalsAndNameThread
std::function< void(LogString threadName, std::thread::id threadId, std::thread::native_handle_type nativeHandle)> ThreadStarted
Called when a new thread has started.
Definition: threadutility.h:50
std::function< void()> ThreadStartPre
A function that will be called before a thread is started.
Definition: threadutility.h:37
Definition: configuration.h:25
std::basic_string< logchar > LogString
Definition: logstring.h:60