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