mirror of
https://github.com/NixOS/nix.git
synced 2025-12-22 17:01:08 +01:00
Fix path locks move/assignment
No copying allowed Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
This commit is contained in:
parent
a6eb2e91b7
commit
3a62be7227
1 changed files with 16 additions and 0 deletions
|
|
@ -33,6 +33,22 @@ private:
|
|||
public:
|
||||
PathLocks();
|
||||
PathLocks(const std::set<std::filesystem::path> & paths, const std::string & waitMsg = "");
|
||||
|
||||
PathLocks(PathLocks && other) noexcept
|
||||
: fds(std::exchange(other.fds, {}))
|
||||
, deletePaths(other.deletePaths)
|
||||
{
|
||||
}
|
||||
|
||||
PathLocks & operator=(PathLocks && other) noexcept
|
||||
{
|
||||
fds = std::exchange(other.fds, {});
|
||||
deletePaths = other.deletePaths;
|
||||
return *this;
|
||||
}
|
||||
|
||||
PathLocks(const PathLocks &) = delete;
|
||||
PathLocks & operator=(const PathLocks &) = delete;
|
||||
bool lockPaths(const std::set<std::filesystem::path> & _paths, const std::string & waitMsg = "", bool wait = true);
|
||||
~PathLocks();
|
||||
void unlock();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue