#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); } r> Wojtek's customized Guix
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2019-07-02Merge branch 'master' into stagingMarius Bakke
2019-07-01gnu: behave: Fix build....Danny Milosavljevic
2019-06-29Merge branch 'master' into stagingMarius Bakke
2019-06-24gnu: znc: Switch back to Guix's googletest package....Tobias Geerinckx-Rice
2019-06-24gnu: googletest: Update to 1.8.1....Tobias Geerinckx-Rice
2019-06-20Merge branch 'master' into stagingMarius Bakke
2019-06-19gnu: Add python-pytest-timeout....Ricardo Wurmus
2019-06-18gnu: python-freezegun: Update to 0.3.12....Marius Bakke
2019-05-22gnu: go-github.com-smartystreets-assertions: Fix typo "convenient"....Vagrant Cascadian
2019-05-02gnu: python-flexmock: Update to 0.10.4....Tobias Geerinckx-Rice
2019-04-30gnu: python-nose-timer: Update to 0.7.5....Tobias Geerinckx-Rice
2019-04-24gnu: Add python-pyfakefs and python2-pyfakefs....Chris Marusich
2019-03-28gnu: googletest: Don't use unstable tarball....Efraim Flashner
2019-03-23gnu: Add python-minimock....Pierre Langlois
2019-03-18Correct name and email address for ng0....ng0
2019-03-14gnu: go-gopkg.in-check.v1: Update to 0.0.0-1.788fd78....Leo Famulari