From 3aefd00f6aebad7c50210e68650cb8c42e0835cd Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 4 Oct 2011 12:13:13 +0200 Subject: Cleanup joinable threads on termination Always invoke pthread_join() when we blow up a thread via pthread_cancel() (avoid zombie threads). Signed-off-by: Lukas Fleischer --- src/notify.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/notify.c') diff --git a/src/notify.c b/src/notify.c index 1b7e924..188d92c 100644 --- a/src/notify.c +++ b/src/notify.c @@ -188,7 +188,10 @@ void notify_stop_main_thread (void) { if (notify_t_main) - pthread_cancel (notify_t_main); + { + pthread_cancel (notify_t_main); + pthread_join (notify_t_main, NULL); + } } /* -- cgit v1.2.3