celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject svn commit: r1643878 - /celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
Date Mon, 08 Dec 2014 18:20:31 GMT
Author: bpetri
Date: Mon Dec  8 18:20:31 2014
New Revision: 1643878

URL: http://svn.apache.org/r1643878
Log:
CELIX-192: added locking and cleanup

Modified:
    celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c

Modified: celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c?rev=1643878&r1=1643877&r2=1643878&view=diff
==============================================================================
--- celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
(original)
+++ celix/trunk/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
Mon Dec  8 18:20:31 2014
@@ -194,6 +194,8 @@ celix_status_t remoteServiceAdmin_create
 celix_status_t remoteServiceAdmin_stop(remote_service_admin_pt admin) {
 	celix_status_t status = CELIX_SUCCESS;
 
+    celixThreadMutex_lock(&admin->exportedServicesLock);
+
 	hash_map_iterator_pt iter = hashMapIterator_create(admin->exportedServices);
 	while (hashMapIterator_hasNext(iter)) {
 		array_list_pt exports = hashMapIterator_nextValue(iter);
@@ -204,6 +206,7 @@ celix_status_t remoteServiceAdmin_stop(r
 		}
 	}
     hashMapIterator_destroy(iter);
+    celixThreadMutex_unlock(&admin->exportedServicesLock);
 
     celixThreadMutex_lock(&admin->importedServicesLock);
 
@@ -234,6 +237,9 @@ celix_status_t remoteServiceAdmin_stop(r
 		admin->ctx = NULL;
 	}
 
+	hashMap_destroy(admin->exportedServices, false, false);
+	hashMap_destroy(admin->importedServices, false, false);
+
 	logHelper_stop(admin->loghelper);
 	logHelper_destroy(&admin->loghelper);
 



Mime
View raw message