[Internal: merge sync-agent]
[platform/core/system/sync-agent.git] / src / framework / engine-controller / interface.c
index e4a24ca..4a2f22e 100755 (executable)
@@ -557,7 +557,14 @@ void ec_run_engine_controller(ec_engine_controller_t * engine_controller)
 
        retm_if(engine_controller == NULL, "ec_engine_controller_t is NULL !!");
 
-       pthread_create(&(engine_controller->thread_id), NULL, (ec_thread_start_routine_cb) _engine_controller_logic, (void *)engine_controller);
+       int status_thread_create = 0;
+       status_thread_create = pthread_create(&(engine_controller->thread_id), NULL, (ec_thread_start_routine_cb) _engine_controller_logic, (void *)engine_controller);
+       if(status_thread_create != 0) {
+               _DEBUG_WARNING("pthread_create [%d]", status_thread_create );
+               _EXTERN_FUNC_EXIT;
+               return;
+       }
+
        pthread_detach(engine_controller->thread_id);
 
        _EXTERN_FUNC_EXIT;
@@ -653,7 +660,14 @@ void ec_run_engine_controller_receiver(ec_engine_controller_receiver_t * engine_
        retm_if(engine_controller_receiver == NULL, "ec_engine_controller_receiver_t is NULL !!");
 
        /* TODO */
-       pthread_create(&(engine_controller_receiver->thread_id), NULL, (ec_thread_start_routine_cb) _engine_controller_receiver_logic, (void *)engine_controller_receiver);
+       int status_thread_create = 0;
+       status_thread_create = pthread_create(&(engine_controller_receiver->thread_id), NULL, (ec_thread_start_routine_cb) _engine_controller_receiver_logic, (void *)engine_controller_receiver);
+       if(status_thread_create != 0) {
+               _DEBUG_WARNING("pthread_create [%d]", status_thread_create );
+               _EXTERN_FUNC_EXIT;
+               return;
+       }
+
        pthread_detach(engine_controller_receiver->thread_id);
 
        _EXTERN_FUNC_EXIT;