9 #include "quill/backend/BackendOptions.h" 10 #include "quill/backend/BackendWorker.h" 11 #include "quill/backend/ManualBackendWorker.h" 12 #include "quill/core/Attributes.h" 27 #if defined(_WIN32) && defined(_MSC_VER) && !defined(__GNUC__) 29 #pragma warning(disable : 4324) 53 friend class quill::Backend;
54 friend class quill::BackendTscClock;
61 QUILL_ATTRIBUTE_COLD
void start_backend_thread(
BackendOptions const& options)
64 _backend_worker.
run(options);
68 QUILL_ATTRIBUTE_COLD std::once_flag& get_start_once_flag() noexcept
70 return *_start_once_flag.load();
74 QUILL_ATTRIBUTE_COLD
void stop_backend_thread() noexcept
76 _backend_worker.
stop();
78 auto* new_flag =
new std::once_flag();
79 std::once_flag* old_flag = _start_once_flag.exchange(new_flag);
84 QUILL_NODISCARD uint32_t get_backend_thread_id()
const noexcept
90 void notify_backend_thread() noexcept { _backend_worker.
notify(); }
93 QUILL_NODISCARD
bool is_backend_thread_running()
const noexcept
95 return _backend_worker.is_running();
99 QUILL_NODISCARD uint64_t convert_rdtsc_to_epoch_time(uint64_t rdtsc_value)
const 107 return &_manual_backend_worker;
112 QUILL_NODISCARD
bool is_atexit_registered()
const noexcept
114 return _atexit_registered.load();
118 void set_atexit_registered() noexcept
120 _atexit_registered.store(
true);
126 std::atomic<std::once_flag*> _start_once_flag{
new std::once_flag};
127 std::atomic<bool> _atexit_registered{
false};
130 #if defined(_WIN32) && defined(_MSC_VER) && !defined(__GNUC__) void notify()
Wakes up the backend worker thread.
Definition: BackendWorker.h:238
QUILL_ATTRIBUTE_COLD void run(BackendOptions const &options)
Starts the backend worker thread.
Definition: BackendWorker.h:138
A utility class for accessing the Time Stamp Counter (TSC) clock used by the backend logging thread...
Definition: BackendTscClock.h:33
QUILL_NODISCARD uint64_t time_since_epoch(uint64_t rdtsc_value) const
Access the rdtsc class from any thread to convert an rdtsc value to wall time.
Definition: BackendWorker.h:112
Setups a signal handler to handle fatal signals.
Definition: BackendManager.h:24
Provides access to common collection class that are used by both the frontend and the backend compone...
Definition: BackendManager.h:38
QUILL_ATTRIBUTE_COLD void stop() noexcept
Stops the backend worker thread.
Definition: BackendWorker.h:212
This class can be used when you want to run the backend worker on your own thread.
Definition: ManualBackendWorker.h:19
QUILL_NODISCARD uint32_t get_backend_thread_id() const noexcept
Get the backend worker's thread id.
Definition: BackendWorker.h:129
Definition: BackendWorker.h:77
Configuration options for the backend.
Definition: BackendOptions.h:30