Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:24:43

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 {
0016     if (worker_thread_.joinable())
0017     {
0018         {
0019             std::lock_guard<std::mutex> lock(mutex_);
0020             active_ = false;
0021         }
0022         cv_.notify_one();
0023         worker_thread_.join();
0024     }
0025 }
0026 
0027 } // namespace details
0028 } // namespace spdlog