9 #include "quill/backend/BackendOptions.h" 10 #include "quill/backend/BackendWorker.h" 11 #include "quill/backend/ManualBackendWorker.h" 12 #include "quill/core/Attributes.h" 47 friend class quill::Backend;
48 friend class quill::BackendTscClock;
55 QUILL_ATTRIBUTE_COLD
void start_backend_thread(
BackendOptions const& options)
58 _backend_worker.
run(options);
62 QUILL_ATTRIBUTE_COLD std::once_flag& get_start_once_flag() noexcept
64 return *_start_once_flag.load();
68 QUILL_ATTRIBUTE_COLD
void stop_backend_thread() noexcept
70 _backend_worker.
stop();
72 auto* new_flag =
new std::once_flag();
73 std::once_flag* old_flag = _start_once_flag.exchange(new_flag);
78 QUILL_NODISCARD uint32_t get_backend_thread_id()
const noexcept
84 void notify_backend_thread() noexcept { _backend_worker.
notify(); }
87 QUILL_NODISCARD
bool is_backend_thread_running()
const noexcept
89 return _backend_worker.is_running();
93 QUILL_NODISCARD uint64_t convert_rdtsc_to_epoch_time(uint64_t rdtsc_value)
const 101 return &_manual_backend_worker;
107 std::atomic<std::once_flag*> _start_once_flag{
new std::once_flag};
void notify()
Wakes up the backend worker thread.
Definition: BackendWorker.h:237
QUILL_ATTRIBUTE_COLD void run(BackendOptions const &options)
Starts the backend worker thread.
Definition: BackendWorker.h:133
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:107
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:32
QUILL_ATTRIBUTE_COLD void stop() noexcept
Stops the backend worker thread.
Definition: BackendWorker.h:211
This class can be used when you want to run the backend worker on your own thread.
Definition: ManualBackendWorker.h:20
QUILL_NODISCARD uint32_t get_backend_thread_id() const noexcept
Get the backend worker's thread id.
Definition: BackendWorker.h:124
Definition: BackendWorker.h:72
Configuration options for the backend.
Definition: BackendOptions.h:30