Skip to content

Commit 8770108

Browse files
committed
lock IPC cache lock before changing its stats
1 parent bc279d1 commit 8770108

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ipc_cache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ umfIpcOpenedCacheCreate(ipc_opened_cache_eviction_cb_t eviction_cb) {
144144

145145
void umfIpcOpenedCacheDestroy(ipc_opened_cache_handle_t cache) {
146146
ipc_opened_cache_entry_t *entry, *tmp;
147+
utils_mutex_lock(&(cache->global->cache_lock));
148+
147149
HASH_ITER(hh, cache->hash_table, entry, tmp) {
148150
DL_DELETE(cache->global->lru_list, entry);
149151
HASH_DEL(cache->hash_table, entry);
@@ -154,6 +156,7 @@ void umfIpcOpenedCacheDestroy(ipc_opened_cache_handle_t cache) {
154156
}
155157
HASH_CLEAR(hh, cache->hash_table);
156158

159+
utils_mutex_unlock(&(cache->global->cache_lock));
157160
umf_ba_global_free(cache);
158161
}
159162

0 commit comments

Comments
 (0)