Do not waiting the 30 secs for terminating slaves.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 22 May 2014 11:36:18 +0000 (20:36 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 22 May 2014 11:36:18 +0000 (20:36 +0900)
For handling the USR1 signal.

Change-Id: Ida29ba8dbcca7d1dcb57e709da57e06baccb2e9e

include/slave_life.h
packaging/data-provider-master.spec
src/main.c
src/setting.c
src/slave_life.c

index 156c4a8..7f477f3 100644 (file)
@@ -206,7 +206,7 @@ extern int slave_need_to_reactivate(struct slave_node *slave);
 extern int slave_network(const struct slave_node *slave);
 extern void slave_set_network(struct slave_node *slave, int network);
 
-extern int slave_deactivate_all(int reactivate, int reactivate_instances);
+extern int slave_deactivate_all(int reactivate, int reactivate_instances, int no_timer);
 extern int slave_activate_all(void);
 
 extern void slave_set_control_option(struct slave_node *slave, int ctrl);
index 35e84a6..90de36d 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name: data-provider-master
 Summary: Master service provider for liveboxes
-Version: 0.43.1
+Version: 0.43.2
 Release: 1
 Group: HomeTF/Livebox
 License: Flora
index 28ef512..0462124 100644 (file)
@@ -304,7 +304,7 @@ static Eina_Bool signal_cb(void *data, Ecore_Fd_Handler *handler)
                 */
 #if defined(HAVE_LIVEBOX)
                CRITICAL_LOG("USRS1, Deactivate ALL\n");
-               slave_deactivate_all(0, 1);
+               slave_deactivate_all(0, 1, 1);
 #endif
        } else if (fdsi.ssi_signo == SIGUSR2) {
                /*!
index e9bb5df..84cb0b1 100644 (file)
@@ -157,7 +157,7 @@ static void low_mem_cb(keynode_t *node, void *user_data)
                CRITICAL_LOG("Low memory: level %d\n", val);
                if (s_info.deactivated == 0) {
                        s_info.deactivated = 1;
-                       //slave_deactivate_all(0, 1);
+                       //slave_deactivate_all(0, 1, 0);
                        malloc_trim(0);
                        ErrPrint("Fall into the low mem status\n");
                }
index 74f59b4..87cc45d 100644 (file)
@@ -775,7 +775,7 @@ static Eina_Bool terminate_timer_cb(void *data)
        return ECORE_CALLBACK_CANCEL;
 }
 
-HAPI struct slave_node *slave_deactivate(struct slave_node *slave, int direct)
+HAPI struct slave_node *slave_deactivate(struct slave_node *slave, int no_timer)
 {
        int ret;
 
@@ -808,7 +808,7 @@ HAPI struct slave_node *slave_deactivate(struct slave_node *slave, int direct)
                (void)slave_rpc_disconnect(slave);
        } else if (slave->terminate_timer) {
                ErrPrint("Terminate timer is already fired (%d)\n", slave->pid);
-       } else if (!direct) {
+       } else if (!no_timer) {
                DbgPrint("Fire the terminate timer: %d\n", slave->pid);
                slave->terminate_timer = ecore_timer_add(SLAVE_ACTIVATE_TIME, terminate_timer_cb, slave);
                if (!slave->terminate_timer) {
@@ -1653,7 +1653,7 @@ HAPI void slave_set_network(struct slave_node *slave, int network)
        slave->network = network;
 }
 
-HAPI int slave_deactivate_all(int reactivate, int reactivate_instances)
+HAPI int slave_deactivate_all(int reactivate, int reactivate_instances, int no_timer)
 {
        Eina_List *l;
        Eina_List *n;
@@ -1670,7 +1670,7 @@ HAPI int slave_deactivate_all(int reactivate, int reactivate_instances)
                slave_set_reactivate_instances(slave, reactivate_instances);
                slave_set_reactivation(slave, reactivate);
 
-               if (!slave_deactivate(slave, 0)) {
+               if (!slave_deactivate(slave, no_timer)) {
                        s_info.slave_list = eina_list_remove(s_info.slave_list, slave);
                }