mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use class template argument deduction for locks
This commit is contained in:
@@ -116,14 +116,14 @@ private:
|
||||
void
|
||||
add (std::shared_ptr<Child> const& child)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard lock(mutex_);
|
||||
list_.emplace(child.get(), child);
|
||||
}
|
||||
|
||||
void
|
||||
remove (Child* child)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard lock(mutex_);
|
||||
list_.erase(child);
|
||||
if (list_.empty())
|
||||
cond_.notify_one();
|
||||
@@ -134,7 +134,7 @@ private:
|
||||
{
|
||||
std::vector<std::shared_ptr<Child>> v;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
std::lock_guard lock(mutex_);
|
||||
v.reserve(list_.size());
|
||||
if (closed_)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user