1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Make drv hash modulo memo table thread-safe

Let's get one step closer to the daemon not needing to fork.
This commit is contained in:
John Ericson 2020-11-19 16:50:06 +00:00
parent 79aa7d9518
commit 2113ae2d85
3 changed files with 21 additions and 16 deletions

View file

@ -210,7 +210,8 @@ DrvHashModulo hashDerivationModulo(Store & store, const Derivation & drv, bool m
/* Memoisation of hashDerivationModulo(). */
typedef std::map<StorePath, DrvHashModulo> DrvHashes;
extern DrvHashes drvHashes; // FIXME: global, not thread-safe
// FIXME: global, though at least thread-safe.
extern Sync<DrvHashes> drvHashes;
/* Memoisation of `readDerivation(..).resove()`. */
typedef std::map<