Author: abroekhuis
Date: Thu Jun 16 11:33:13 2011
New Revision: 1136381

URL: http://svn.apache.org/viewvc?rev=1136381&view=rev
Log:
APR fixes

Modified:
    incubator/celix/trunk/celix_test/array_list_test.c
    incubator/celix/trunk/framework/private/include/bundle_cache.h
    incubator/celix/trunk/framework/private/src/bundle_cache.c
    incubator/celix/trunk/framework/private/src/framework.c

Modified: incubator/celix/trunk/celix_test/array_list_test.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/celix_test/array_list_test.c?rev=1136381&r1=1136380&r2=1136381&view=diff
==============================================================================
--- incubator/celix/trunk/celix_test/array_list_test.c (original)
+++ incubator/celix/trunk/celix_test/array_list_test.c Thu Jun 16 11:33:13 2011
@@ -323,8 +323,11 @@ int main (int argc, char** argv) {
        }
 
        /* Run all tests using the CUnit Basic interface */
-       CU_basic_set_mode(CU_BRM_VERBOSE);
-       CU_basic_run_tests();
+       CU_set_output_filename("ArrayList");
+       CU_list_tests_to_file();
+       CU_automated_run_tests();
+//     CU_basic_set_mode(CU_BRM_VERBOSE);
+//     CU_basic_run_tests();
        CU_cleanup_registry();
        return CU_get_error();
 }

Modified: incubator/celix/trunk/framework/private/include/bundle_cache.h
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/bundle_cache.h?rev=1136381&r1=1136380&r2=1136381&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/bundle_cache.h (original)
+++ incubator/celix/trunk/framework/private/include/bundle_cache.h Thu Jun 16 
11:33:13 2011
@@ -33,6 +33,7 @@
 typedef struct bundleCache * BUNDLE_CACHE;
 
 celix_status_t bundleCache_create(PROPERTIES configurationMap, apr_pool_t *mp, 
BUNDLE_CACHE *bundle_cache);
+celix_status_t bundleCache_destroy(BUNDLE_CACHE cache);
 celix_status_t bundleCache_getArchives(BUNDLE_CACHE cache, ARRAY_LIST 
*archives);
 celix_status_t bundleCache_createArchive(BUNDLE_CACHE cache, long id, char * 
location, apr_pool_t *bundlePool, BUNDLE_ARCHIVE *archive);
 celix_status_t bundleCache_delete(BUNDLE_CACHE cache);

Modified: incubator/celix/trunk/framework/private/src/bundle_cache.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle_cache.c?rev=1136381&r1=1136380&r2=1136381&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_cache.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_cache.c Thu Jun 16 
11:33:13 2011
@@ -70,6 +70,11 @@ celix_status_t bundleCache_create(PROPER
        return status;
 }
 
+celix_status_t bundleCache_destroy(BUNDLE_CACHE cache) {
+    properties_destroy(cache->configurationMap);
+    return CELIX_SUCCESS;
+}
+
 celix_status_t bundleCache_delete(BUNDLE_CACHE cache) {
        return bundleCache_deleteTree(cache->cacheDir, cache->mp);
 }

Modified: incubator/celix/trunk/framework/private/src/framework.c
URL: 
http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/framework.c?rev=1136381&r1=1136380&r2=1136381&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/framework.c (original)
+++ incubator/celix/trunk/framework/private/src/framework.c Thu Jun 16 11:33:13 
2011
@@ -187,6 +187,8 @@ celix_status_t framework_destroy(FRAMEWO
 
        serviceRegistry_destroy(framework->registry);
 
+       //bundleCache_destroy(framework->cache);
+
        apr_pool_destroy(framework->mp);
 
        return status;
@@ -1215,10 +1217,12 @@ celix_status_t framework_waitForStop(FRA
                celix_log("Error waiting for shutdown gate.");
                return CELIX_FRAMEWORK_EXCEPTION;
        }
+       printf("waited for stop\n");
        if (apr_thread_mutex_unlock(framework->mutex) != 0) {
                celix_log("Error unlocking the framework.");
                return CELIX_FRAMEWORK_EXCEPTION;
        }
+       printf("waited for stop finish\n");
        return CELIX_SUCCESS;
 }
 
@@ -1278,6 +1282,7 @@ celix_status_t bundleActivator_stop(void
 
            if (apr_thread_create(&shutdownThread, NULL, framework_shutdown, 
framework, framework->mp) == APR_SUCCESS) {
             //int err = pthread_create(&shutdownThread, NULL, 
framework_shutdown, framework);
+            apr_thread_detach(shutdownThread);
            } else {
             celix_log("Could not create shutdown thread, normal exit not 
possible.");
                status = CELIX_FRAMEWORK_EXCEPTION;


Reply via email to