diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-08-16 20:03:32 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-10-13 12:12:44 +0200 |
commit | 8614cf13344eca75074cd4af20fd90238571b0b6 (patch) | |
tree | 367c7d7a0d3a5bf7a38f6d18a0bc56e15ec0b057 /src/libstore/pathlocks.hh | |
parent | 9947f1646a26b339fff2e02b77798e9841fac7f0 (diff) |
Non-blocking garbage collector
The garbage collector no longer blocks other processes from
adding/building store paths or adding GC roots. To prevent the
collector from deleting store paths just added by another process,
processes need to connect to the garbage collector via a Unix domain
socket to register new temporary roots.
Diffstat (limited to 'src/libstore/pathlocks.hh')
-rw-r--r-- | src/libstore/pathlocks.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh index 411da0222..919c8904c 100644 --- a/src/libstore/pathlocks.hh +++ b/src/libstore/pathlocks.hh @@ -35,4 +35,18 @@ public: void setDeletion(bool deletePaths); }; +struct FdLock +{ + int fd; + bool acquired = false; + + FdLock(int fd, LockType lockType, bool wait, std::string_view waitMsg); + + ~FdLock() + { + if (acquired) + lockFile(fd, ltNone, false); + } +}; + } |