Deviopath › Swift

Serialized Counter

Hard · Concurrency

Actors serialize access. Model that: runAdds(n) adds 1, n times, sequentially (the safe equivalent of await counter.add() in a loop) and returns n.

Write runAdds(_:).

Next: Break a Cycle