Skip to content

Commit 6231c7d

Browse files
atilanevesclaude
andauthored
std.stdio: read the refcount atomically in a File.detach unittest (#11167)
A direct read of the shared refcount is rejected by -preview=nosharedaccess. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ee49d73 commit 6231c7d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎std/stdio.d‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ Throws: `ErrnoException` on failure if closing the file.
898898
auto f2 = f;
899899
f2.detach();
900900
}
901-
assert(f._p.refs == 1);
901+
assert(atomicLoad(f._p.refs) == 1);
902902
f.close();
903903
}
904904

0 commit comments

Comments
 (0)