Skip to content
Permalink
Browse files
rename variable name
  • Loading branch information
xuzhenbao committed Apr 12, 2022
1 parent 7db1762 commit fb280b76743af359f5c684bca051769253c7a2ad
Showing 1 changed file with 5 additions and 5 deletions.
@@ -62,7 +62,7 @@ struct topology_manager {
celix_thread_mutex_t importedServicesLock;
celix_thread_mutexattr_t importedServicesLockAttr;
hash_map_pt importedServices;
bool stopAddImportedService;
bool closed;

scope_pt scope;

@@ -96,7 +96,7 @@ celix_status_t topologyManager_create(celix_bundle_context_t *context, celix_log
celixThreadMutexAttr_create(&(*manager)->importedServicesLockAttr);
celixThreadMutexAttr_settype(&(*manager)->importedServicesLockAttr, CELIX_THREAD_MUTEX_RECURSIVE);
celixThreadMutex_create(&(*manager)->importedServicesLock, &(*manager)->importedServicesLockAttr);
(*manager)->stopAddImportedService = false;
(*manager)->closed = false;

celixThreadMutex_create(&(*manager)->exportedServicesLock, NULL);
celixThreadMutex_create(&(*manager)->listenerListLock, NULL);
@@ -159,7 +159,7 @@ celix_status_t topologyManager_closeImports(topology_manager_pt manager) {

status = celixThreadMutex_lock(&manager->importedServicesLock);

manager->stopAddImportedService = true;
manager->closed = true;

hash_map_iterator_pt iter = hashMapIterator_create(manager->importedServices);

@@ -484,8 +484,8 @@ celix_status_t topologyManager_addImportedService(void *handle, endpoint_descrip

if (celixThreadMutex_lock(&manager->importedServicesLock) == CELIX_SUCCESS) {

// bundleActivator is stopping, stop add imported service
if (manager->stopAddImportedService) {
// We should not try to add imported services to a closed listener.
if (manager->closed) {
celixThreadMutex_unlock(&manager->importedServicesLock);
celix_logHelper_log(manager->loghelper, CELIX_LOG_LEVEL_INFO,"TOPOLOGY_MANAGER: Endpointer listener will close, Ignore imported service (%s; %s).", endpoint->service, endpoint->id);
return CELIX_SUCCESS;

0 comments on commit fb280b7

Please sign in to comment.