mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 15:32:43 +01:00
document thread-unsafe mutation in PosixSourceAccessor
This commit is contained in:
parent
b5f765b7eb
commit
866c9179a0
1 changed files with 2 additions and 0 deletions
|
|
@ -114,6 +114,8 @@ std::optional<SourceAccessor::Stat> PosixSourceAccessor::maybeLstat(const CanonP
|
||||||
auto st = cachedLstat(path);
|
auto st = cachedLstat(path);
|
||||||
if (!st)
|
if (!st)
|
||||||
return std::nullopt;
|
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);
|
mtime = std::max(mtime, st->st_mtime);
|
||||||
return Stat{
|
return Stat{
|
||||||
.type = S_ISREG(st->st_mode) ? tRegular
|
.type = S_ISREG(st->st_mode) ? tRegular
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue