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:
@@ -43,7 +43,7 @@ SHAMapInnerNode::clone(std::uint32_t seq) const
|
||||
p->mIsBranch = mIsBranch;
|
||||
p->mFullBelowGen = mFullBelowGen;
|
||||
p->mHashes = mHashes;
|
||||
std::lock_guard <std::mutex> lock(childLock);
|
||||
std::lock_guard lock(childLock);
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
p->mChildren[i] = mChildren[i];
|
||||
@@ -62,7 +62,7 @@ SHAMapInnerNodeV2::clone(std::uint32_t seq) const
|
||||
p->mHashes = mHashes;
|
||||
p->common_ = common_;
|
||||
p->depth_ = depth_;
|
||||
std::lock_guard <std::mutex> lock(childLock);
|
||||
std::lock_guard lock(childLock);
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
p->mChildren[i] = mChildren[i];
|
||||
@@ -686,7 +686,7 @@ SHAMapInnerNode::getChildPointer (int branch)
|
||||
assert (branch >= 0 && branch < 16);
|
||||
assert (isInner());
|
||||
|
||||
std::lock_guard <std::mutex> lock (childLock);
|
||||
std::lock_guard lock (childLock);
|
||||
return mChildren[branch].get ();
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ SHAMapInnerNode::getChild (int branch)
|
||||
assert (branch >= 0 && branch < 16);
|
||||
assert (isInner());
|
||||
|
||||
std::lock_guard <std::mutex> lock (childLock);
|
||||
std::lock_guard lock (childLock);
|
||||
return mChildren[branch];
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ SHAMapInnerNode::canonicalizeChild(int branch, std::shared_ptr<SHAMapAbstractNod
|
||||
assert (node);
|
||||
assert (node->getNodeHash() == mHashes[branch]);
|
||||
|
||||
std::lock_guard <std::mutex> lock (childLock);
|
||||
std::lock_guard lock (childLock);
|
||||
if (mChildren[branch])
|
||||
{
|
||||
// There is already a node hooked up, return it
|
||||
@@ -732,7 +732,7 @@ SHAMapInnerNodeV2::canonicalizeChild(int branch, std::shared_ptr<SHAMapAbstractN
|
||||
assert (node);
|
||||
assert (node->getNodeHash() == mHashes[branch]);
|
||||
|
||||
std::lock_guard <std::mutex> lock (childLock);
|
||||
std::lock_guard lock (childLock);
|
||||
if (mChildren[branch])
|
||||
{
|
||||
// There is already a node hooked up, return it
|
||||
|
||||
Reference in New Issue
Block a user