mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
refactor: Use move semantics in CCheckQueue::Add
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
This commit is contained in:
@@ -140,6 +140,17 @@ struct FrozenCleanupCheck {
|
||||
cv.wait(l, []{ return nFrozen.load(std::memory_order_relaxed) == 0;});
|
||||
}
|
||||
}
|
||||
FrozenCleanupCheck(FrozenCleanupCheck&& other) noexcept
|
||||
{
|
||||
should_freeze = other.should_freeze;
|
||||
other.should_freeze = false;
|
||||
}
|
||||
FrozenCleanupCheck& operator=(FrozenCleanupCheck&& other) noexcept
|
||||
{
|
||||
should_freeze = other.should_freeze;
|
||||
other.should_freeze = false;
|
||||
return *this;
|
||||
}
|
||||
void swap(FrozenCleanupCheck& x) noexcept
|
||||
{
|
||||
std::swap(should_freeze, x.should_freeze);
|
||||
|
||||
Reference in New Issue
Block a user