Added synchronization to accesses to in-memory map