diff --git a/src/libstore/include/nix/store/pathlocks.hh b/src/libstore/include/nix/store/pathlocks.hh index 7e27bec4c..e6bb898e7 100644 --- a/src/libstore/include/nix/store/pathlocks.hh +++ b/src/libstore/include/nix/store/pathlocks.hh @@ -33,6 +33,22 @@ private: public: PathLocks(); PathLocks(const std::set & 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 & _paths, const std::string & waitMsg = "", bool wait = true); ~PathLocks(); void unlock();