* 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:
Eelco Dolstra 2003-08-06 09:34:04 +00:00
parent 720f06e3b0
commit 236eb59293

View file

@ -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);