diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-06-20 17:48:10 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-06-20 17:48:10 +0000 |
commit | dbf6d7e783ff86c60d39f5000e341082d2604e85 (patch) | |
tree | 34522d5619d43bfdc7ef1a87639a17ae2b1093de /src/libstore/pathlocks.hh | |
parent | cc51f9c539a3822c84a2285efcec11b577727234 (diff) |
* Concurrent GC on Cygwin.
Diffstat (limited to 'src/libstore/pathlocks.hh')
-rw-r--r-- | src/libstore/pathlocks.hh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh index 2fd0e0d1e..911fe4579 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); |