|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Worker thread for batch processing with jthread compatibility. More...

Public Types | |
| using | process_callback = std::function<void()> |
Public Member Functions | |
| batch_processing_jthread_worker (process_callback callback, std::mutex ¬ify_mutex, std::condition_variable ¬ify_cv) | |
| ~batch_processing_jthread_worker () | |
| void | start () |
| void | stop () |
| bool | is_running () const noexcept |
Private Attributes | |
| process_callback | callback_ |
| std::mutex & | notify_mutex_ |
| std::condition_variable & | notify_cv_ |
| compat_jthread | thread_ |
| std::atomic< bool > | running_ {false} |
| std::shared_ptr< simple_stop_source > | stop_source_ |
Worker thread for batch processing with jthread compatibility.
Uses std::jthread with std::stop_token for cooperative cancellation where available, falls back to std::thread with manual stop mechanism for environments without jthread support (e.g., libc++).
Definition at line 33 of file batch_processor.cpp.
| using kcenon::logger::async::batch_processing_jthread_worker::process_callback = std::function<void()> |
Definition at line 35 of file batch_processor.cpp.
|
inlineexplicit |
Definition at line 37 of file batch_processor.cpp.
|
inline |
Definition at line 48 of file batch_processor.cpp.
References stop().

|
inlinenodiscardnoexcept |
Definition at line 104 of file batch_processor.cpp.
References running_.
|
inline |
Definition at line 52 of file batch_processor.cpp.
References callback_, notify_cv_, notify_mutex_, running_, stop(), stop_source_, and thread_.

|
inline |
Definition at line 94 of file batch_processor.cpp.
References kcenon::logger::async::compat_jthread::join(), kcenon::logger::async::compat_jthread::request_stop(), running_, and thread_.
Referenced by start(), and ~batch_processing_jthread_worker().


|
private |
Definition at line 109 of file batch_processor.cpp.
Referenced by start().
|
private |
Definition at line 111 of file batch_processor.cpp.
Referenced by start().
|
private |
Definition at line 110 of file batch_processor.cpp.
Referenced by start().
|
private |
Definition at line 113 of file batch_processor.cpp.
Referenced by is_running(), start(), and stop().
|
private |
Definition at line 115 of file batch_processor.cpp.
Referenced by start().
|
private |
Definition at line 112 of file batch_processor.cpp.