aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/pathlocks.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/pathlocks.hh')
-rw-r--r--src/libstore/pathlocks.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh
index 411da0222..919c8904c 100644
--- a/src/libstore/pathlocks.hh
+++ b/src/libstore/pathlocks.hh
@@ -35,4 +35,18 @@ public:
void setDeletion(bool deletePaths);
};
+struct FdLock
+{
+ int fd;
+ bool acquired = false;
+
+ FdLock(int fd, LockType lockType, bool wait, std::string_view waitMsg);
+
+ ~FdLock()
+ {
+ if (acquired)
+ lockFile(fd, ltNone, false);
+ }
+};
+
}