mirror of
https://github.com/gabime/spdlog.git
synced 2025-04-01 02:42:41 +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
|
#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