From 016a8673de49c960471e8dd56d0b4e285d58974a Mon Sep 17 00:00:00 2001 From: BeyondWUXF <46481385+BeyondWUXF@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:01:46 +0800 Subject: [PATCH 1/2] fix lock type error --- src/PropertyServer/CacheInfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PropertyServer/CacheInfo.h b/src/PropertyServer/CacheInfo.h index 516691c..28326f5 100644 --- a/src/PropertyServer/CacheInfo.h +++ b/src/PropertyServer/CacheInfo.h @@ -47,7 +47,7 @@ class CacheInfoList bool get(const std::string &cacheName, CacheInfo &cacheInfo) { - TC_ThreadWLock rlock(_rwl); + TC_ThreadRLock rlock(_rwl); if(modules[_index].find(cacheName) != modules[_index].end()) { cacheInfo = modules[_index][cacheName]; From 3d9cf1c2f15017293f3c14e59a82907055061123 Mon Sep 17 00:00:00 2001 From: BeyondWUXF <46481385+BeyondWUXF@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:03:44 +0800 Subject: [PATCH 2/2] fix lock type error --- src/PropertyServer/CacheInfoManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PropertyServer/CacheInfoManager.cpp b/src/PropertyServer/CacheInfoManager.cpp index fdb59f8..541b292 100644 --- a/src/PropertyServer/CacheInfoManager.cpp +++ b/src/PropertyServer/CacheInfoManager.cpp @@ -63,7 +63,7 @@ void CacheInfoManager::reload() bool CacheInfoManager::getModuleInfo(const string &cacheName, CacheModuleInfo &moduleInfo) const { - TC_ThreadWLock rlock(_rwl); + TC_ThreadRLock rlock(_rwl); const map &infos = _moduleInfos[_moduleInfoIndex]; map::const_iterator it = infos.find(cacheName); @@ -75,4 +75,4 @@ bool CacheInfoManager::getModuleInfo(const string &cacheName, CacheModuleInfo &m } return false; -} \ No newline at end of file +}