PengZheng commented on code in PR #840:
URL: https://github.com/apache/celix/pull/840#discussion_r3079534761
##########
libs/framework/src/dm_service_dependency.c:
##########
@@ -310,13 +300,14 @@ celix_status_t
celix_dmServiceDependency_invokeRemove(celix_dm_service_dependenc
bool celix_dmServiceDependency_isAvailable(celix_dm_service_dependency_t
*dependency) {
celixThreadMutex_lock(&dependency->mutex);
- bool avail = dependency->trackedSvcCount > 0;
+ bool avail = (dependency->minimalCardinality == 0) ?
(dependency->trackedSvcCount > 0)
+ :
(dependency->trackedSvcCount >= dependency->minimalCardinality);
Review Comment:
I would extract this line into a static internal function and reuse it for
celix_dmServiceDependency_createInfo
--
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]