celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [08/21] celix git commit: CELIX-272: fix race condition in topology manager
Date Mon, 16 Nov 2015 20:17:22 GMT
CELIX-272: fix race condition in topology manager


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e8479259
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e8479259
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e8479259

Branch: refs/heads/feature/CELIX-272_synchronization_service_registry
Commit: e84792592e2b83c1149452901a37df822e3b487d
Parents: fa50089
Author: Bjoern Petri <bpetri@apache.org>
Authored: Sun Nov 15 22:25:21 2015 +0100
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Sun Nov 15 22:25:21 2015 +0100

----------------------------------------------------------------------
 .../topology_manager/private/src/topology_manager.c          | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/e8479259/remote_services/topology_manager/private/src/topology_manager.c
----------------------------------------------------------------------
diff --git a/remote_services/topology_manager/private/src/topology_manager.c b/remote_services/topology_manager/private/src/topology_manager.c
index acc6941..af650ff 100644
--- a/remote_services/topology_manager/private/src/topology_manager.c
+++ b/remote_services/topology_manager/private/src/topology_manager.c
@@ -279,10 +279,16 @@ celix_status_t topologyManager_rsaRemoved(void * handle, service_reference_pt
re
         service_reference_pt key = hashMapEntry_getKey(entry);
         hash_map_pt exports = hashMapEntry_getValue(entry);
 
+
+        /*
+         * the problem here is that also the rsa has a a list of
+         * endpoints which is destroyed when closing the exportRegistrtaiom
+         */
         array_list_pt exports_list = hashMap_get(exports, rsa);
 
         if (exports_list != NULL) {
-            for (exportsIter = 0; exportsIter < arrayList_size(exports_list); exportsIter++)
{
+            int exportListSize = arrayList_size(exports_list);
+            for (exportsIter = 0; exports_list != NULL && exportsIter < exportListSize;
exportsIter++) {
                 export_registration_pt export = arrayList_get(exports_list, exportsIter);
                 topologyManager_notifyListenersEndpointRemoved(manager, rsa, export);
                 rsa->exportRegistration_close(export);


Mime
View raw message