2012-07-18 21:59:03 +03:00
|
|
|
#pragma once
|
2023-04-01 06:18:41 +03:00
|
|
|
///@file
|
2003-08-01 17:11:19 +03:00
|
|
|
|
2023-10-25 07:43:36 +03:00
|
|
|
#include "file-descriptor.hh"
|
2006-09-05 00:06:23 +03:00
|
|
|
|
|
|
|
namespace nix {
|
2003-08-01 17:11:19 +03:00
|
|
|
|
2017-01-25 13:51:35 +02:00
|
|
|
class PathLocks
|
2003-08-01 17:11:19 +03:00
|
|
|
{
|
|
|
|
private:
|
2006-09-05 00:06:23 +03:00
|
|
|
typedef std::pair<int, Path> FDPair;
|
2022-02-21 17:25:12 +02:00
|
|
|
std::list<FDPair> fds;
|
2003-11-21 18:05:19 +02:00
|
|
|
bool deletePaths;
|
2003-08-01 17:11:19 +03:00
|
|
|
|
|
|
|
public:
|
2004-05-11 21:05:44 +03:00
|
|
|
PathLocks();
|
2006-06-15 14:56:49 +03:00
|
|
|
PathLocks(const PathSet & paths,
|
2022-02-25 17:00:00 +02:00
|
|
|
const std::string & waitMsg = "");
|
2009-03-23 03:05:54 +02:00
|
|
|
bool lockPaths(const PathSet & _paths,
|
2022-02-25 17:00:00 +02:00
|
|
|
const std::string & waitMsg = "",
|
2009-03-23 03:05:54 +02:00
|
|
|
bool wait = true);
|
2003-08-01 17:11:19 +03:00
|
|
|
~PathLocks();
|
2009-02-16 11:24:20 +02:00
|
|
|
void unlock();
|
2003-11-21 18:05:19 +02:00
|
|
|
void setDeletion(bool deletePaths);
|
2003-08-01 17:11:19 +03:00
|
|
|
};
|
|
|
|
|
2006-09-05 00:06:23 +03:00
|
|
|
}
|
2024-04-17 18:34:09 +03:00
|
|
|
|
|
|
|
#include "pathlocks-impl.hh"
|