#pragma once #include "types.hh" namespace nix { /* 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. */ void deleteLockFile(const Path & path, int fd); enum LockType { ltRead, ltWrite, ltNone }; bool lockFile(int fd, LockType lockType, bool wait); class PathLocks { private: typedef std::pair FDPair; list fds; bool deletePaths; public: PathLocks(); PathLocks(const PathSet & paths, const string & waitMsg = ""); bool lockPaths(const PathSet & _paths, const string & waitMsg = "", bool wait = true); ~PathLocks(); void unlock(); void setDeletion(bool deletePaths); }; bool pathIsLockedByMe(const Path & path); } Wojtek's customized Guix
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2020-03-16gnu: agda: Use HTTPS home page....Tobias Geerinckx-Rice
2019-11-20gnu: agda: Update to 2.6.0.1....Timothy Sample
2019-08-31gnu: Move non-compilers out of haskell.scm....Robert Vollmert
2019-08-28gnu: agda-ial: Fix install step....John Soo
2019-08-28gnu: agda-ial: Fetch source from Git....Ludovic Courtès
2019-08-28gnu: Add agda-ial....John Soo
2019-08-07gnu: Remove ghc-parsec, ghc-stm, ghc-text, ghc-xhtml....Robert Vollmert