1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 06:01:00 +01:00

Merge pull request #14096 from Mic92/concurrency-bugs-2

document thread-unsafe mutation in PosixSourceAccessor
This commit is contained in:
John Ericson 2025-09-27 11:18:56 -04:00 committed by GitHub
commit 3bf1268ac6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,6 +114,8 @@ std::optional<SourceAccessor::Stat> PosixSourceAccessor::maybeLstat(const CanonP
auto st = cachedLstat(path);
if (!st)
return std::nullopt;
// This makes the accessor thread-unsafe, but we only seem to use the actual value in a single threaded context in
// `src/libfetchers/path.cc`.
mtime = std::max(mtime, st->st_mtime);
return Stat{
.type = S_ISREG(st->st_mode) ? tRegular