- attempt to protect cache manager mutex creation behind a static mutex
This commit is contained in:
parent
b928bbbb40
commit
a413fb5c31
|
@ -48,8 +48,11 @@ protected:
|
|||
|
||||
template <typename T>
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue