From: Julien Desfossez Date: Fri, 17 Aug 2012 17:22:16 +0000 (-0400) Subject: cleanup exit path X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=24306dda1f206d5451f60f480a7b4d6f697676d7;p=lttngtop.git cleanup exit path Signed-off-by: Julien Desfossez --- diff --git a/src/cursesdisplay.c b/src/cursesdisplay.c index f80c5a6..c745713 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(); } @@ -1506,6 +1508,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 79e3e2c..89c0a1d 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++);