From 1328aa33077fd1cf84869e366c82b8ea1d1abb5d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 31 Jan 2005 10:27:25 +0000 Subject: * 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. --- scripts/nix-collect-garbage.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts/nix-collect-garbage.in') diff --git a/scripts/nix-collect-garbage.in b/scripts/nix-collect-garbage.in index f11ed2cb69..c92737f25c 100644 --- a/scripts/nix-collect-garbage.in +++ b/scripts/nix-collect-garbage.in @@ -9,6 +9,7 @@ my $storeDir = "@storedir@"; my %alive; my $gcOper = "--delete"; +my $extraArgs = ""; my @roots = (); @@ -19,6 +20,9 @@ for (my $i = 0; $i < scalar @ARGV; $i++) { if ($arg eq "--delete" || $arg eq "--print-live" || $arg eq "--print-dead") { $gcOper = $arg; } + elsif ($arg =~ /^-v+$/) { + $extraArgs = "$extraArgs $arg"; + } else { die "unknown argument `$arg'" }; } @@ -66,7 +70,7 @@ findRoots 1, $rootsDir; # Run the collector with the roots we found. -my $pid = open2(">&1", \*WRITE, "@bindir@/nix-store --gc $gcOper") +my $pid = open2(">&1", \*WRITE, "@bindir@/nix-store --gc $gcOper $extraArgs") or die "cannot run `nix-store --gc'"; foreach my $root (@roots) { -- cgit 1.4.1