PengZheng commented on code in PR #583:
URL: https://github.com/apache/celix/pull/583#discussion_r1250068763


##########
libs/framework/src/framework.c:
##########
@@ -1179,37 +1168,22 @@ static void* framework_shutdown(void *framework) {
 
 
     size = celix_arrayList_size(stopEntries);
-    for (int i = size-1; i >= 0; --i) { //note loop in reverse order -> stop 
later installed bundle first
-        celix_framework_bundle_entry_t *entry = 
celix_arrayList_get(stopEntries, i);
-
-        //NOTE possible starvation.
-        fw_bundleEntry_waitTillUseCountIs(entry, 1);  //note this function has 
1 use count.
-
-        bundle_state_e state = celix_bundle_getState(entry->bnd);
-        if (state == CELIX_BUNDLE_STATE_ACTIVE || state == 
CELIX_BUNDLE_STATE_STARTING) {
-            celix_framework_stopBundleEntry(fw, entry);
-        }
-    }
     for (int i = size-1; i >= 0; --i) { //note loop in reverse order -> 
uninstall later installed bundle first
         celix_framework_bundle_entry_t *entry = 
celix_arrayList_get(stopEntries, i);
         celix_framework_uninstallBundleEntry(fw, entry, false);
     }
     celix_arrayList_destroy(stopEntries);
 
 
-    // 'stop' framework bundle
+    // make sure the framework has been stopped
     if (fwEntry != NULL) {
-        bundle_t *bnd = fwEntry->bnd;
-        fw_bundleEntry_waitTillUseCountIs(fwEntry, 1); //note this function 
has 1 use count.

Review Comment:
   This is not race-free. 



-- 
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

Reply via email to