This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch support/2.4
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 35e79ccf8905bd727127e876cbd4f12b645345b8
Author: PengZheng <[email protected]>
AuthorDate: Thu Nov 23 14:22:42 2023 +0800

    [CID 331914]Fix missing lock.
    
    (cherry picked from commit 421d6f68f2613562d6bd17b447f71ea114822cbe)
---
 libs/framework/src/framework.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libs/framework/src/framework.c b/libs/framework/src/framework.c
index 812b7799..3b41463d 100644
--- a/libs/framework/src/framework.c
+++ b/libs/framework/src/framework.c
@@ -2404,7 +2404,7 @@ void celix_framework_updateBundleAsync(celix_framework_t 
*fw, long bndId, const
 
 static celix_array_list_t* 
celix_framework_listBundlesInternal(celix_framework_t* framework, bool 
activeOnly) {
     celix_array_list_t* result = celix_arrayList_create();
-    celixThreadMutex_lock(&framework->dispatcher.mutex);
+    celix_auto(celix_mutex_lock_guard_t) lock = 
celixMutexLockGuard_init(&framework->installedBundles.mutex);
     for (int i = 0; i < 
celix_arrayList_size(framework->installedBundles.entries); ++i) {
         celix_framework_bundle_entry_t* entry = 
celix_arrayList_get(framework->installedBundles.entries, i);
         if (entry->bndId == CELIX_FRAMEWORK_BUNDLE_ID) {
@@ -2416,7 +2416,6 @@ static celix_array_list_t* 
celix_framework_listBundlesInternal(celix_framework_t
             celix_arrayList_addLong(result, entry->bndId);
         }
     }
-    celixThreadMutex_unlock(&framework->dispatcher.mutex);
     return result;
 }
 

Reply via email to