Created by: ryanslade
Before we were locking well before actually making any changes to the map which would hold the lock for too long.
Also added some comments around why we lock in a couple of other places as it wasn't obvious.
Existing tests pass
Push commits to the source branch or add previously merged commits to review them.