diff --git a/mars_server.c b/mars_server.c index fa3add33..ef98abba 100644 --- a/mars_server.c +++ b/mars_server.c @@ -418,7 +418,7 @@ static int server_switch(struct server_brick *brick) mars_power_led_off((void*)brick, false); - MARS_INF("starting....."); + MARS_INF("starting.....\n"); spin_lock(&server_lock); list_add(&brick->server_link, &server_list); @@ -566,7 +566,7 @@ static int _server_thread(void *data) MARS_INF("-------- server starting on host '%s' ----------\n", id); - while (!kthread_should_stop()) { + while (!kthread_should_stop() && mars_global && mars_global->global_power.button) { struct server_brick *brick; struct mars_socket *new_socket; @@ -607,6 +607,7 @@ static int _server_thread(void *data) goto err; } + msleep(1000); continue; err: diff --git a/sy_old/mars_light.c b/sy_old/mars_light.c index 7c873af1..17605bd9 100644 --- a/sy_old/mars_light.c +++ b/sy_old/mars_light.c @@ -928,6 +928,7 @@ int remote_thread(void *data) continue; } MARS_DBG("successfully opened socket to '%s'\n", real_peer); + msleep(1000); continue; } @@ -962,8 +963,9 @@ int remote_thread(void *data) mars_free_dent_all(NULL, &old_list); + msleep(1000); if (!kthread_should_stop()) - msleep(5 * 1000); + msleep(4000); } MARS_INF("-------- remote thread terminating\n");