+9
−3
Loading
The multi-step logic around incrementing the safeprom counter (incrementing the current true count, checking whether it exceeds the current rounded count, and incrementing the rounded count), this code is not well suited for atomic operations. Instead, this change surrounds the Inc() and Write() functions with a sync.Mutex lock.