1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 15:32:43 +01:00

Add getConcurrent helper function

This commit is contained in:
Eelco Dolstra 2025-09-07 16:54:39 +02:00
parent 377b60ee9b
commit 7f9b5226af
2 changed files with 12 additions and 3 deletions

View file

@ -95,9 +95,7 @@ std::optional<struct stat> PosixSourceAccessor::cachedLstat(const CanonPath & pa
// former is not hashable on libc++.
Path absPath = makeAbsPath(path).string();
std::optional<Cache::mapped_type> res;
cache.cvisit(absPath, [&](auto & x) { res.emplace(x.second); });
if (res)
if (auto res = getConcurrent(cache, absPath))
return *res;
auto st = nix::maybeLstat(absPath.c_str());