#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
2016-11-21gnu: swig: Update to 3.0.10....Leo Famulari
2016-07-29Merge branch 'master' into core-updatesMark H Weaver
2016-07-29gnu: Use define-public to export packages....David Craven
2016-07-22Merge branch 'master' into core-updates...Leo Famulari
2016-07-21gnu: Update URLs for sourceforge.net....Leo Famulari
2016-06-13gnu: swig: Adjust to pcre output split....Ludovic Courtès
2015-06-18gnu: swig: Update to 3.0.5....Mark H Weaver
2015-02-27gnu: Remove now unneeded 'localedef' invocations....Ludovic Courtès
2015-01-06gnu: swig: Build a UTF-8 locale for the tests....Mark H Weaver
2014-11-04gnu: swig: Disable input python....Andreas Enge
2014-11-04gnu: swig: Update to 3.0.2....Andreas Enge
2014-11-04gnu: swig: Update to 2.0.12....Andreas Enge
2014-07-20gnu: Enable swig tests....John Darrington