mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
refactor: Use move semantics in CCheckQueue::Add
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
This commit is contained in:
parent
0682003214
commit
6c2d5972f3
3 changed files with 14 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue