mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-13 17:22:06 +08:00
Removed periodic worker
This commit is contained in:
parent
2419dc7373
commit
77d6215483
@ -198,7 +198,6 @@ set(SPDLOG_SRCS
|
|||||||
"src/details/os_filesystem.cpp"
|
"src/details/os_filesystem.cpp"
|
||||||
"src/details/log_msg.cpp"
|
"src/details/log_msg.cpp"
|
||||||
"src/details/log_msg_buffer.cpp"
|
"src/details/log_msg_buffer.cpp"
|
||||||
"src/details/periodic_worker.cpp"
|
|
||||||
"src/details/context.cpp"
|
"src/details/context.cpp"
|
||||||
"src/details/thread_pool.cpp"
|
"src/details/thread_pool.cpp"
|
||||||
"src/sinks/base_sink.cpp"
|
"src/sinks/base_sink.cpp"
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
|
||||||
|
|
||||||
#include "spdlog/details/periodic_worker.h"
|
|
||||||
|
|
||||||
namespace spdlog {
|
|
||||||
namespace details {
|
|
||||||
|
|
||||||
// stop the worker thread and join it
|
|
||||||
periodic_worker::~periodic_worker() {
|
|
||||||
if (worker_thread_.joinable()) {
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
|
||||||
active_ = false;
|
|
||||||
}
|
|
||||||
cv_.notify_one();
|
|
||||||
worker_thread_.join();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace details
|
|
||||||
} // namespace spdlog
|
|
Loading…
Reference in New Issue
Block a user