From 6d718bab3c9d6cbb0c776851119530e593888a67 Mon Sep 17 00:00:00 2001 From: Arnaud Blanchard <arnaud.blanchard@ensea.fr> Date: Wed, 17 Jul 2019 11:27:01 +0200 Subject: [PATCH] small fixes --- include/blc_command.h | 6 ------ src/blc_loop.cpp | 9 --------- 2 files changed, 15 deletions(-) diff --git a/include/blc_command.h b/include/blc_command.h index d0da62c..84cc23d 100644 --- a/include/blc_command.h +++ b/include/blc_command.h @@ -28,8 +28,6 @@ Few functions helping for pseudo realtime applications. #include "blc_tools.h" -#define BLC_COMMAND_LOOP_THREAD() for(blc_command_loop_init(-2); blc_command_loop_start();blc_command_loop_end()) - /** period in microseconds 0 for system as fast as possible, -1 for blocking on keyborad, -2 blocking after first iteration. @@ -128,10 +126,6 @@ void blc_command_loop_init(long loop_period); int blc_command_loop_start(); void blc_command_loop_end(); -/**Wait until the blc_loop_stop. - Return the loop_thred pointer (always NULL for now)*/ -void *blc_loop_wait_stop(); - /** Stop a textual program * - Send a quitting message with the name of the app on stderr. * - Send 'q' and flush on stdout if it is a piped output diff --git a/src/blc_loop.cpp b/src/blc_loop.cpp index dd895d0..b00836b 100644 --- a/src/blc_loop.cpp +++ b/src/blc_loop.cpp @@ -14,10 +14,8 @@ struct timeval blc_loop_timer; static uint blc_period=0; static uint blc_duration=0; static uint blc_duration_min=UINT_MAX, blc_duration_max=0; - static long blc_current_duration; static int intermediate_iteration; - long blc_command_loop_period=-2; //unitialised uint64_t blc_loop_iteration_limit=UINT64_MAX; uint64_t blc_loop_iteration=0; @@ -192,7 +190,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; } @@ -298,9 +295,3 @@ void blc_command_loop_end(){ intermediate_iteration++; blc_loop_iteration++; } - -void *blc_loop_wait_stop(){ - void *result; - SYSTEM_ERROR_CHECK(pthread_join(loop_thread, &result), -1, NULL); - return result; -} -- GitLab