test(acl): correct the array-cell comment — captured locals do take ref (re-review nit)
This commit is contained in:
@@ -578,9 +578,9 @@ public sealed class SessionAclDecisionCacheTests(ITestOutputHelper output)
|
||||
const int rounds = 10_000;
|
||||
const int spinsBeforeYield = 4_000;
|
||||
|
||||
// Array-as-ref-cell: a one-element array is the cheapest storage a lambda can close over AND that
|
||||
// Volatile.Read/Write can take a `ref` to — a captured local cannot be passed by ref, and a plain
|
||||
// field would need the test moved onto the class.
|
||||
// Array-as-ref-cell: the one cell that is re-seated every round (a fresh cache per round), shared
|
||||
// by the starter and both racers. A captured local would also take `ref` (gate/finished below do
|
||||
// exactly that) — the array is a readability choice marking the re-seated slot, not a necessity.
|
||||
var slot = new SessionAclDecisionCache[1];
|
||||
var gate = 0; // starter's release signal: the round number both racers are cleared to run
|
||||
var finished = 0; // racers' completion count for the current round
|
||||
|
||||
Reference in New Issue
Block a user