Commit 68aa48e0 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Clean functions

parent e35be972
...@@ -232,25 +232,6 @@ int blc_command_try_to_interpret(){ ...@@ -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){ void blc_command_update_int_cb(char const *argument, void *int_pt){
char *endptr; char *endptr;
int value; int value;
......
...@@ -195,7 +195,6 @@ static void *command_thread_interpret_loop(void *){ ...@@ -195,7 +195,6 @@ static void *command_thread_interpret_loop(void *){
while(blc_status!=BLC_QUIT){ while(blc_status!=BLC_QUIT){
blc_command_interpret_block(); blc_command_interpret_block();
if (blc_command_loop_period==-1) BLC_PTHREAD_CHECK(pthread_mutex_unlock(&mutex_lock_keyboard), NULL); if (blc_command_loop_period==-1) BLC_PTHREAD_CHECK(pthread_mutex_unlock(&mutex_lock_keyboard), NULL);
//blc_command_interpret();
} }
return NULL; return NULL;
} }
...@@ -248,7 +247,7 @@ int blc_command_loop_start(){ ...@@ -248,7 +247,7 @@ int blc_command_loop_start(){
else if (blc_status==BLC_RUN){ else if (blc_status==BLC_RUN){
//We wait for semaphore //We wait for semaphore
FOR(i, waiting_semaphores_nb) { 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); SYSTEM_ERROR_CHECK(sem_wait(blocking_semaphore), -1, NULL);
} }
blocking_semaphore=NULL; blocking_semaphore=NULL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment