From: Julien Desfossez Date: Fri, 17 Aug 2012 17:22:16 +0000 (-0400) Subject: cleanup exit path X-Git-Tag: v0.3~105 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=33572a17ebf19098e1f1d3f1088e000e276eec60;p=lttngtop.git cleanup exit path Signed-off-by: Julien Desfossez --- diff --git a/src/cursesdisplay.c b/src/cursesdisplay.c index c8ac5db..02764dd 100644 --- a/src/cursesdisplay.c +++ b/src/cursesdisplay.c @@ -75,11 +75,13 @@ void reset_ncurses() curs_set(1); endwin(); quit = 1; + sem_post(&pause_sem); + sem_post(&timer); + sem_post(&goodtodisplay); } static void handle_sigterm(int signal) { - fprintf(stderr, "caugh signal\n"); pthread_cancel(keyboard_thread); reset_ncurses(); } @@ -1507,6 +1509,7 @@ void *handle_keyboard(void *p) } else { resume_display(); } + break; case 'r': toggle_pref_panel(); break; diff --git a/src/lttngtop.c b/src/lttngtop.c index 8a3416c..26faf1d 100644 --- a/src/lttngtop.c +++ b/src/lttngtop.c @@ -124,11 +124,12 @@ void *ncurses_display(void *p) sem_wait(&pause_sem); if (quit) { + sem_post(&pause_sem); + sem_post(&timer); reset_ncurses(); pthread_exit(0); } - copy = g_ptr_array_index(copies, current_display_index); assert(copy); display(current_display_index++);