PengZheng commented on a change in pull request #399: URL: https://github.com/apache/celix/pull/399#discussion_r816449269
########## File path: libs/framework/src/service_registry.c ########## @@ -277,13 +277,12 @@ celix_status_t serviceRegistry_unregisterService(service_registry_pt registry, b service_reference_pt ref = refsMap != NULL ? hashMap_get(refsMap, (void*)registration->serviceId) : NULL; if (ref != NULL) { - serviceReference_invalidate(ref); + serviceReference_invalidateCache(ref); } } hashMapIterator_destroy(iter); + serviceRegistration_invalidate(registration); celixThreadRwlock_unlock(®istry->lock); Review comment: Yes. If serviceRegistry_getServiceReference happens before this critical section, the valid registration will be invalidated by the critical section; if it happens after this critical section, then the returned reference can only bind to invalid registration. The lock guarantees that these are the only possible cases. -- 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: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org