mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
* Allow locks on paths to be acquired recursively (that is, if the
process is already holding a lock on a path, it may acquire the lock again without blocking or failing). (This might be dangerous, not sure). Necessary for fast builds to work.
This commit is contained in:
parent
720f06e3b0
commit
236eb59293
1 changed files with 4 additions and 2 deletions
|
@ -28,8 +28,10 @@ PathLocks::PathLocks(const Strings & _paths)
|
||||||
|
|
||||||
debug(format("locking path `%1%'") % path);
|
debug(format("locking path `%1%'") % path);
|
||||||
|
|
||||||
if (lockedPaths.find(lockPath) != lockedPaths.end())
|
if (lockedPaths.find(lockPath) != lockedPaths.end()) {
|
||||||
throw Error(format("already holding lock on `%1%'") % lockPath);
|
debug(format("already holding lock on `%1%'") % lockPath);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Open/create the lock file. */
|
/* Open/create the lock file. */
|
||||||
int fd = open(lockPath.c_str(), O_WRONLY | O_CREAT, 0666);
|
int fd = open(lockPath.c_str(), O_WRONLY | O_CREAT, 0666);
|
||||||
|
|
Loading…
Reference in a new issue