18#ifndef _LOG4CXX_THREADUTILITY_H
19#define _LOG4CXX_THREADUTILITY_H
46typedef std::function<void(
LogString threadName,
47 std::thread::id threadId,
75 std::unique_ptr<priv_data> m_priv;
80 static std::shared_ptr<ThreadUtility>
instance();
109 std::thread::id thread_id,
110 std::thread::native_handle_type native_handle);
122 template<
class Function,
class... Args>
133 std::thread t( f, args... );
Definition: threadutility.h:66
static std::shared_ptr< ThreadUtility > instance()
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.
std::thread createThread(LogString name, Function &&f, Args &&... args)
Start a thread.
Definition: threadutility.h:123
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.
LOG4CXX_PTR_DEF(AppenderAttachableImpl)
std::function< void()> ThreadStartPost
Called after a thread has started.
Definition: threadutility.h:54
ThreadConfigurationType
Definition: threadutility.h:56
@ 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:48
std::function< void()> ThreadStartPre
A function that will be called before a thread is started.
Definition: threadutility.h:35
Definition: messagehandler.h:23
std::basic_string< logchar > LogString
Definition: logstring.h:66