diff --git a/src/libutil/posix-source-accessor.cc b/src/libutil/posix-source-accessor.cc index bcf453cba..35047f89e 100644 --- a/src/libutil/posix-source-accessor.cc +++ b/src/libutil/posix-source-accessor.cc @@ -90,14 +90,14 @@ bool PosixSourceAccessor::pathExists(const CanonPath & path) std::optional PosixSourceAccessor::cachedLstat(const CanonPath & path) { - static Sync>> _cache; + static SharedSync>> _cache; // Note: we convert std::filesystem::path to Path because the // former is not hashable on libc++. Path absPath = makeAbsPath(path).string(); { - auto cache(_cache.lock()); + auto cache(_cache.read()); auto i = cache->find(absPath); if (i != cache->end()) return i->second; }