The problem:
Currently, GetOrSet/GetAndDelete methods call an internal get method, which locks the mutex and unlocks it before returning, and then call the Set/Delete method, which also locks the mutex and unlocks it before returning. There's a small time gap between the get call and the set/delete call when the mutex isn't locked during which it's possible that the data might be altered. We should probably create another internal get method that would do no locking internally, allowing us to lock the mutex in GetOrSet/GetAndDelete.
The problem: Currently, GetOrSet/GetAndDelete methods call an internal get method, which locks the mutex and unlocks it before returning, and then call the Set/Delete method, which also locks the mutex and unlocks it before returning. There's a small time gap between the get call and the set/delete call when the mutex isn't locked during which it's possible that the data might be altered. We should probably create another internal
get
method that would do no locking internally, allowing us to lock the mutex in GetOrSet/GetAndDelete.