* 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
1 changed files with 4 additions and 2 deletions

View File

@ -28,8 +28,10 @@ PathLocks::PathLocks(const Strings & _paths)
debug(format("locking path `%1%'") % path);
if (lockedPaths.find(lockPath) != lockedPaths.end())
throw Error(format("already holding lock on `%1%'") % lockPath);
if (lockedPaths.find(lockPath) != lockedPaths.end()) {
debug(format("already holding lock on `%1%'") % lockPath);
continue;
}
/* Open/create the lock file. */
int fd = open(lockPath.c_str(), O_WRONLY | O_CREAT, 0666);