mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 18:41:35 +08:00
use std::lock_guard instead of std::unique_lock (#3179)
This commit is contained in:
parent
15fcde8ee3
commit
a3d3df0a56
@ -148,19 +148,19 @@ public:
|
||||
#endif
|
||||
|
||||
size_t overrun_counter() {
|
||||
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||
std::lock_guard<std::mutex> lock(queue_mutex_);
|
||||
return q_.overrun_counter();
|
||||
}
|
||||
|
||||
size_t discard_counter() { return discard_counter_.load(std::memory_order_relaxed); }
|
||||
|
||||
size_t size() {
|
||||
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||
std::lock_guard<std::mutex> lock(queue_mutex_);
|
||||
return q_.size();
|
||||
}
|
||||
|
||||
void reset_overrun_counter() {
|
||||
std::unique_lock<std::mutex> lock(queue_mutex_);
|
||||
std::lock_guard<std::mutex> lock(queue_mutex_);
|
||||
q_.reset_overrun_counter();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user