nix-super/src/libstore/pathlocks.cc

42 lines
532 B
C++
Raw Normal View History

#include "pathlocks.hh"
#include "util.hh"
2016-12-09 14:26:43 +02:00
#include "sync.hh"
#include "signals.hh"
2003-09-11 11:31:29 +03:00
#include <cerrno>
#include <cstdlib>
2003-09-11 11:31:29 +03:00
namespace nix {
PathLocks::PathLocks()
2003-11-21 18:05:19 +02:00
: deletePaths(false)
{
}
PathLocks::PathLocks(const PathSet & paths, const std::string & waitMsg)
: deletePaths(false)
{
lockPaths(paths, waitMsg);
}
PathLocks::~PathLocks()
{
try {
unlock();
} catch (...) {
ignoreException();
}
}
2003-11-21 18:05:19 +02:00
void PathLocks::setDeletion(bool deletePaths)
{
this->deletePaths = deletePaths;
}
}