use mutexes to lock access to the underlying map