about summary refs log tree commit diff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-03-23T01·05+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-03-23T01·05+0000
commitcacff1be886ed975bbef1b17151b25c633711256 (patch)
treea7e466012a5df86433b7e348c446cf98f9f032c2 /src/libstore/globals.cc
parent58969fa2bf9d5e662c372bdf970470b8226bd4c7 (diff)
* No longer block while waiting for a lock on a store path. Instead
  poll for it (i.e. if we can't acquire the lock, then let the main
  select() loop wait for at most a few seconds and then try again).
  This improves parallelism: if two nix-store processes are both
  trying to build a path at the same time, the second one shouldn't
  block; it should first see if it can build other goals.  Also, it
  prevents the deadlocks that have been occuring in Hydra lately,
  where a process waits for a lock held by another process that's
  waiting for a lock held by the first.

  The downside is that polling isn't really elegant, but POSIX doesn't
  provide a way to wait for locks in a select() loop.  The only
  solution would be to spawn a thread for each lock to do a blocking
  fcntl() and then signal the main thread, but that would require
  pthreads.

Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r--src/libstore/globals.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 907627b6591c..cc0e44e8e34e 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -24,7 +24,7 @@ Verbosity buildVerbosity = lvlInfo;
 unsigned int maxBuildJobs = 1;
 bool readOnlyMode = false;
 string thisSystem = "unset";
-unsigned int maxSilentTime = 0;
+time_t maxSilentTime = 0;
 Paths substituters;
 bool useBuildHook = true;
 bool printBuildTrace = false;