celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1646857 - in /celix/trunk: dependency_manager_2/private/src/dm_component_impl.c examples/whiteboard/tracker_depman/CMakeLists.txt
Date Fri, 19 Dec 2014 20:41:39 GMT
Author: abroekhuis
Date: Fri Dec 19 20:41:39 2014
New Revision: 1646857

URL: http://svn.apache.org/r1646857
Log:
Fixed several linux vs osx problems.

Modified:
    celix/trunk/dependency_manager_2/private/src/dm_component_impl.c
    celix/trunk/examples/whiteboard/tracker_depman/CMakeLists.txt

Modified: celix/trunk/dependency_manager_2/private/src/dm_component_impl.c
URL: http://svn.apache.org/viewvc/celix/trunk/dependency_manager_2/private/src/dm_component_impl.c?rev=1646857&r1=1646856&r2=1646857&view=diff
==============================================================================
--- celix/trunk/dependency_manager_2/private/src/dm_component_impl.c (original)
+++ celix/trunk/dependency_manager_2/private/src/dm_component_impl.c Fri Dec 19 20:41:39 2014
@@ -31,6 +31,7 @@
 
 struct dm_executor {
     pthread_t runningThread;
+    bool runningThreadSet;
     linked_list_pt workQueue;
 
     pthread_mutex_t mutex;
@@ -973,15 +974,15 @@ celix_status_t executor_executeTask(dm_e
     celix_status_t status = CELIX_SUCCESS;
 
     // Check thread and executor thread, if the same, execute immediately.
-    bool execute = false;
-    pthread_mutex_lock(&executor->mutex);
-    pthread_t currentThread = pthread_self();
-    if (pthread_equal(executor->runningThread, currentThread)) {
-        execute = true;
-    }
-    pthread_mutex_unlock(&executor->mutex);
-    // For now, just schedule.
+//    bool execute = false;
+//    pthread_mutex_lock(&executor->mutex);
+//    pthread_t currentThread = pthread_self();
+//    if (pthread_equal(executor->runningThread, currentThread)) {
+//        execute = true;
+//    }
+//    pthread_mutex_unlock(&executor->mutex);
 
+    // For now, just schedule.
     executor_schedule(executor, component, command, data);
     executor_execute(executor);
 
@@ -994,8 +995,9 @@ celix_status_t executor_execute(dm_execu
 
     pthread_mutex_lock(&executor->mutex);
     bool execute = false;
-    if (executor->runningThread == NULL) {
+    if (!executor->runningThreadSet) {
         executor->runningThread = currentThread;
+        executor->runningThreadSet = true;
         execute = true;
     }
     pthread_mutex_unlock(&executor->mutex);
@@ -1020,7 +1022,7 @@ celix_status_t executor_runTasks(dm_exec
 
             pthread_mutex_lock(&executor->mutex);
         }
-        executor->runningThread = NULL;
+        executor->runningThreadSet = false;
         pthread_mutex_unlock(&executor->mutex);
 
 //        pthread_mutex_lock(&executor->mutex);

Modified: celix/trunk/examples/whiteboard/tracker_depman/CMakeLists.txt
URL: http://svn.apache.org/viewvc/celix/trunk/examples/whiteboard/tracker_depman/CMakeLists.txt?rev=1646857&r1=1646856&r2=1646857&view=diff
==============================================================================
--- celix/trunk/examples/whiteboard/tracker_depman/CMakeLists.txt (original)
+++ celix/trunk/examples/whiteboard/tracker_depman/CMakeLists.txt Fri Dec 19 20:41:39 2014
@@ -30,4 +30,10 @@ include_directories("${PROJECT_SOURCE_DI
 include_directories("../publisherService/public/include")
 include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
 include_directories("${PROJECT_SOURCE_DIR}/log_service/public/include")
+
+# Use some magic to include all symbols of the static library
+IF(APPLE)
 target_link_libraries(tracker_depman celix_framework -Wl,-all_load dependency_manager2)
+else()
+target_link_libraries(tracker_depman -Wl,--whole-archive dependency_manager2 -Wl,--no-whole-archive
celix_framework)
+ENDIF()



Mime
View raw message