diff --git a/source/shared_lib/include/platform/common/cache_manager.h b/source/shared_lib/include/platform/common/cache_manager.h index e9275dc2..eca95615 100644 --- a/source/shared_lib/include/platform/common/cache_manager.h +++ b/source/shared_lib/include/platform/common/cache_manager.h @@ -48,8 +48,11 @@ protected: template static Mutex & manageCachedItemMutex(string cacheKey) { + static Mutex mutexMap(CODE_AT_LINE); if(itemCacheMutexList.find(cacheKey) == itemCacheMutexList.end()) { + MutexSafeWrapper safeMutex(&mutexMap); itemCacheMutexList[cacheKey] = new Mutex(CODE_AT_LINE); + safeMutex.ReleaseLock(); } Mutex *mutex = itemCacheMutexList[cacheKey]; return *mutex;