PengZheng commented on a change in pull request #399:
URL: https://github.com/apache/celix/pull/399#discussion_r810609234
##########
File path: libs/framework/src/service_registry.c
##########
@@ -151,32 +152,31 @@ celix_status_t
serviceRegistry_destroy(service_registry_pt registry) {
}
celix_status_t serviceRegistry_getRegisteredServices(service_registry_pt
registry, bundle_pt bundle, array_list_pt *services) {
- celix_status_t status = CELIX_SUCCESS;
+ celix_status_t status = CELIX_SUCCESS;
- celixThreadRwlock_writeLock(®istry->lock);
+ celixThreadRwlock_writeLock(®istry->lock);
- array_list_pt regs = (array_list_pt)
hashMap_get(registry->serviceRegistrations, bundle);
- if (regs != NULL) {
- unsigned int i;
- arrayList_create(services);
-
- for (i = 0; i < arrayList_size(regs); i++) {
- service_registration_pt reg = arrayList_get(regs, i);
- if (serviceRegistration_isValid(reg)) {
- service_reference_pt reference = NULL;
- status =
serviceRegistry_getServiceReference_internal(registry, bundle, reg, &reference);
- if (status == CELIX_SUCCESS) {
- arrayList_add(*services, reference);
- }
- }
- }
- }
+ array_list_pt regs = (array_list_pt)
hashMap_get(registry->serviceRegistrations, bundle);
+ if (regs != NULL) {
+ unsigned int i;
+ arrayList_create(services);
- celixThreadRwlock_unlock(®istry->lock);
+ for (i = 0; i < arrayList_size(regs); i++) {
+ service_registration_pt reg = arrayList_get(regs, i);
+ service_reference_pt reference = NULL;
+ //assert(serviceRegistration_isValid(reg));
Review comment:
assertion is commented out to avoid locking
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]