From 68aa48e0609d1e6d517631cbe081b04d27ee8215 Mon Sep 17 00:00:00 2001 From: Arnaud Blanchard <arnaud.blanchard@ensea.fr> Date: Fri, 13 Apr 2018 16:40:12 +0200 Subject: [PATCH] Clean functions --- src/blc_command.cpp | 19 ------------------- src/blc_loop.cpp | 3 +-- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/blc_command.cpp b/src/blc_command.cpp index 801e33b..636a8c9 100644 --- a/src/blc_command.cpp +++ b/src/blc_command.cpp @@ -232,25 +232,6 @@ int blc_command_try_to_interpret(){ } -/// if the parameter is not null we should display the help at each command. -static void *command_thread_interpret_loop(void *){ - while(blc_status==BLC_RUN){ - blc_command_interpret(); - } - return NULL; -} - - -void blc_command_interpret_thread(char const *option, void (*ask_quit_funcion)()){ - pthread_t thread; - - if (ask_quit_funcion==NULL) ask_quit_funcion=blc_command_ask_quit; - blc_command_loop_period=-2; - if (strchr(option, 'h')) blc_command_add("h", (type_blc_command_cb)blc_command_display_help, NULL, "display this help", NULL); - if (strchr(option, 'q')) blc_command_add("q", (type_blc_command_cb)ask_quit_funcion, NULL, "quit the application", NULL); - SYSTEM_ERROR_CHECK(pthread_create(&thread, NULL, command_thread_interpret_loop, NULL), -1, NULL); -} - void blc_command_update_int_cb(char const *argument, void *int_pt){ char *endptr; int value; diff --git a/src/blc_loop.cpp b/src/blc_loop.cpp index b12d2d5..16d4d52 100644 --- a/src/blc_loop.cpp +++ b/src/blc_loop.cpp @@ -195,7 +195,6 @@ static void *command_thread_interpret_loop(void *){ while(blc_status!=BLC_QUIT){ blc_command_interpret_block(); if (blc_command_loop_period==-1) BLC_PTHREAD_CHECK(pthread_mutex_unlock(&mutex_lock_keyboard), NULL); - //blc_command_interpret(); } return NULL; } @@ -248,7 +247,7 @@ int blc_command_loop_start(){ else if (blc_status==BLC_RUN){ //We wait for semaphore FOR(i, waiting_semaphores_nb) { - blocking_semaphore=waiting_semaphores[i]; + blocking_semaphore=waiting_semaphores[i]; //This is used to be able to unlock all blocking semaphore on quiting SYSTEM_ERROR_CHECK(sem_wait(blocking_semaphore), -1, NULL); } blocking_semaphore=NULL; -- GitLab