about summary refs log tree commit diff
path: root/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T09·39+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T09·39+0000
commite0d7e47862aa1b33292fb8d05e5d50ad4ebf3590 (patch)
treea5d96132410ba858faaea0352ef75c11c0a80091 /src/libstore/pathlocks.cc
parent455a7b95776440a56fd5d545d3b9a01cbae1d8e7 (diff)
* PathLocks::lockPaths: don't allow reacquiring a lock we already
  hold.

Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r--src/libstore/pathlocks.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index 03ba4f212439..821d4d02feb0 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -161,10 +161,8 @@ void PathLocks::lockPaths(const PathSet & _paths, const string & waitMsg)
 
         debug(format("locking path `%1%'") % path);
 
-        if (lockedPaths.find(lockPath) != lockedPaths.end()) {
-            debug(format("already holding lock on `%1%'") % lockPath);
-            continue;
-        }
+        if (lockedPaths.find(lockPath) != lockedPaths.end())
+            throw Error("deadlock: trying to re-acquire self-held lock");
 
         AutoCloseFD fd;