aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/gc.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-01-31 10:27:25 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-01-31 10:27:25 +0000
commit1328aa33077fd1cf84869e366c82b8ea1d1abb5d (patch)
tree8f079aabcfb9d1d5b485170e0edb583c052039ee /src/libstore/gc.hh
parenta7668411a10c79ad40c9c18caf2570d5c9f52182 (diff)
* Start of concurrent garbage collection. Processes write temporary
roots to a per-process temporary file in /nix/var/nix/temproots while holding a write lock on that file. The garbage collector acquires read locks on all those files, thus blocking further progress in other Nix processes, and reads the sets of temporary roots.
Diffstat (limited to 'src/libstore/gc.hh')
-rw-r--r--src/libstore/gc.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/gc.hh b/src/libstore/gc.hh
index 2ea851abc..838188ade 100644
--- a/src/libstore/gc.hh
+++ b/src/libstore/gc.hh
@@ -3,6 +3,7 @@
#include "util.hh"
+
/* Garbage collector operation. */
typedef enum { gcReturnLive, gcReturnDead, gcDeleteDead } GCAction;
@@ -14,4 +15,9 @@ typedef enum { gcReturnLive, gcReturnDead, gcDeleteDead } GCAction;
void collectGarbage(const PathSet & roots, GCAction action,
PathSet & result);
+/* Register a temporary GC root. This root will automatically
+ disappear when this process exits. */
+void addTempRoot(const Path & path);
+
+
#endif /* !__GC_H */