this creates a race. If the read and increment cannot be done atomically, this gives incorrect results.

Am I missing something? Imagine a counter at 5. Two calls come in put(6), put(7). The reads go together, then the increments: `5 + (6 - 5) + (7 - 5) = 8`. I don't think read and `+/-` are enough for this.