Photon 1.0.0
Loading...
Searching...
No Matches
periodic_worker-inl.h
Go to the documentation of this file.
1// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
2// Distributed under the MIT License (http://opensource.org/licenses/MIT)
3
4#pragma once
5
6#ifndef SPDLOG_HEADER_ONLY
8#endif
9
10namespace spdlog
11{
12 namespace details
13 {
14
15 // stop the worker thread and join it
17 {
18 if (worker_thread_.joinable())
19 {
20 {
21 std::lock_guard<std::mutex> lock(mutex_);
22 active_ = false;
23 }
24 cv_.notify_one();
25 worker_thread_.join();
26 }
27 }
28
29 } // namespace details
30} // namespace spdlog
std::thread worker_thread_
Definition periodic_worker.h:53
std::mutex mutex_
Definition periodic_worker.h:54
~periodic_worker()
Definition periodic_worker-inl.h:16
bool active_
Definition periodic_worker.h:52
std::condition_variable cv_
Definition periodic_worker.h:55
#define SPDLOG_INLINE
Definition common.h:47
Definition async.h:26
annotation details
Definition tag_strings.h:125