From fd9e49480a40989c407c1de32b86ec35f7b37a87 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 5 Jun 2024 22:24:00 +0200 Subject: [PATCH] PosixSourceAccessor: Use SharedSync --- src/libutil/posix-source-accessor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }