From dbf6d7e783ff86c60d39f5000e341082d2604e85 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Jun 2006 17:48:10 +0000 Subject: * Concurrent GC on Cygwin. --- src/libstore/pathlocks.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/libstore/pathlocks.hh') diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh index 2fd0e0d1ed52..911fe4579f28 100644 --- a/src/libstore/pathlocks.hh +++ b/src/libstore/pathlocks.hh @@ -4,6 +4,16 @@ #include "util.hh" +/* Open (possibly create) a lock file and return the file descriptor. + -1 is returned if create is false and the lock could not be opened + because it doesn't exist. Any other error throws an exception. */ +int openLockFile(const Path & path, bool create); + +/* Delete an open lock file. Both must be called to be fully portable + between Unix and Windows. */ +void deleteLockFilePreClose(const Path & path, int fd); +void deleteLockFilePostClose(const Path & path); + typedef enum LockType { ltRead, ltWrite, ltNone }; bool lockFile(int fd, LockType lockType, bool wait); -- cgit 1.4.1