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/io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index b64dd58..22f8719 100644 --- a/src/io.c +++ b/src/io.c @@ -2927,7 +2927,10 @@ void io_stop_psave_thread (void) { if (io_t_psave) - pthread_cancel (io_t_psave); + { + pthread_cancel (io_t_psave); + pthread_join (io_t_psave, NULL); + } } /* -- cgit v1.2.3-54-g00ecf