Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:47:15

0001 // Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
0002 // Distributed under the MIT License (http://opensource.org/licenses/MIT)
0003 
0004 #pragma once
0005 
0006 #ifndef SPDLOG_HEADER_ONLY
0007     #include <spdlog/details/periodic_worker.h>
0008 #endif
0009 
0010 namespace spdlog {
0011 namespace details {
0012 
0013 // stop the worker thread and join it
0014 SPDLOG_INLINE periodic_worker::~periodic_worker() {
0015     if (worker_thread_.joinable()) {
0016         {
0017             std::lock_guard<std::mutex> lock(mutex_);
0018             active_ = false;
0019         }
0020         cv_.notify_one();
0021         worker_thread_.join();
0022     }
0023 }
0024 
0025 }  // namespace details
0026 }  // namespace spdlog