From 440e0302f56d55602a0eeda2223bb9b473f69590 Mon Sep 17 00:00:00 2001 From: Gabor Janak Date: Mon, 13 Aug 2018 14:00:36 +0200 Subject: [PATCH] Fix forgotten std::parts. move recusive from details to spdlog namespace. --- include/spdlog/async.h | 2 +- include/spdlog/common.h | 4 ++-- include/spdlog/details/mpmc_blocking_q.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/spdlog/async.h b/include/spdlog/async.h index e17ccd14..921d5305 100644 --- a/include/spdlog/async.h +++ b/include/spdlog/async.h @@ -40,7 +40,7 @@ struct async_factory_impl auto ®istry_inst = details::registry::instance(); // create global thread pool if not already exists.. - lock_guard tp_lock(registry_inst.tp_mutex()); + lock_guard tp_lock(registry_inst.tp_mutex()); auto tp = registry_inst.get_tp(); if (tp == nullptr) { diff --git a/include/spdlog/common.h b/include/spdlog/common.h index aa339d3b..b6d6991b 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -81,19 +81,19 @@ class sink; // import into namespace spdlog namespace details { using boost::condition_variable; - using boost::recursive_mutex; using boost::thread; using boost::unique_lock; } // namespace details +using boost::recursive_mutex; using boost::lock_guard; using boost::mutex; #else namespace details { using std::condition_variable; - using std::recursive_mutex; using std::thread; using std::unique_lock; } // namespace details +using std::recursive_mutex; using std::lock_guard; using std::mutex; #endif diff --git a/include/spdlog/details/mpmc_blocking_q.h b/include/spdlog/details/mpmc_blocking_q.h index 65bf7fda..61120e7e 100644 --- a/include/spdlog/details/mpmc_blocking_q.h +++ b/include/spdlog/details/mpmc_blocking_q.h @@ -73,7 +73,7 @@ public: // try to enqueue and block if no room left void enqueue(T &&item) { - std::unique_lock lock(queue_mutex_); + unique_lock lock(queue_mutex_); pop_cv_.wait(lock, [this] { return !this->q_.full(); }); q_.push_back(std::move(item)); push_cv_.notify_one(); @@ -82,7 +82,7 @@ public: // enqueue immediately. overrun oldest message in the queue if no room left. void enqueue_nowait(T &&item) { - std::unique_lock lock(queue_mutex_); + unique_lock lock(queue_mutex_); q_.push_back(std::move(item)); push_cv_.notify_one(); } @@ -91,7 +91,7 @@ public: // Return true, if succeeded dequeue item, false otherwise bool dequeue_for(T &popped_item, chrono::milliseconds wait_duration) { - std::unique_lock lock(queue_mutex_); + unique_lock lock(queue_mutex_); if (!push_cv_.wait_for(lock, wait_duration, [this] { return !this->q_.empty(); })) { return false;