9 #include "quill/backend/BackendOptions.h" 10 #include "quill/backend/BackendWorker.h" 11 #include "quill/backend/ManualBackendWorker.h" 12 #include "quill/core/Attributes.h" 31 #if defined(_WIN32) && defined(_MSC_VER) && !defined(__GNUC__) 33 #pragma warning(disable : 4324) 57 friend class quill::Backend;
58 friend class quill::BackendTscClock;
65 QUILL_ATTRIBUTE_COLD
void start_backend_thread(
BackendOptions const& options)
68 _backend_worker.
run(options);
72 QUILL_ATTRIBUTE_COLD std::once_flag& get_start_once_flag() noexcept
74 return *_start_once_flag.load();
78 QUILL_ATTRIBUTE_COLD
void stop_backend_thread() noexcept
80 _backend_worker.
stop();
82 auto* new_flag =
new std::once_flag();
83 std::once_flag* old_flag = _start_once_flag.exchange(new_flag);
88 QUILL_NODISCARD uint32_t get_backend_thread_id()
const noexcept
94 void notify_backend_thread() noexcept { _backend_worker.
notify(); }
97 QUILL_NODISCARD
bool is_backend_thread_running()
const noexcept
99 return _backend_worker.is_running();
103 QUILL_NODISCARD uint64_t convert_rdtsc_to_epoch_time(uint64_t rdtsc_value)
const 111 return &_manual_backend_worker;
116 QUILL_NODISCARD
bool is_atexit_registered()
const noexcept {
return _atexit_registered.load(); }
119 void set_atexit_registered() noexcept { _atexit_registered.store(
true); }
124 std::atomic<std::once_flag*> _start_once_flag{
new std::once_flag};
125 std::atomic<bool> _atexit_registered{
false};
128 #if defined(_WIN32) && defined(_MSC_VER) && !defined(__GNUC__) void notify()
Wakes up the backend worker thread.
Definition: BackendWorker.h:300
QUILL_ATTRIBUTE_COLD void run(BackendOptions const &options)
Starts the backend worker thread.
Definition: BackendWorker.h:141
A utility class for accessing the Time Stamp Counter (TSC) clock used by the backend logging thread...
Definition: BackendTscClock.h:35
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:115
Setups a signal handler to handle fatal signals.
Definition: BackendManager.h:28
Provides access to common collection class that are used by both the frontend and the backend compone...
Definition: BackendManager.h:42
QUILL_ATTRIBUTE_COLD void stop() noexcept
Stops the backend worker thread.
Definition: BackendWorker.h:248
This class can be used when you want to run the backend worker on your own thread.
Definition: ManualBackendWorker.h:30
QUILL_NODISCARD uint32_t get_backend_thread_id() const noexcept
Get the backend worker's thread id.
Definition: BackendWorker.h:132
Definition: BackendWorker.h:80
Configuration options for the backend.
Definition: BackendOptions.h:51