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 <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2011-10-04 12:13:13 +02:00
parent 4cd62fb0fb
commit 3aefd00f6a
3 changed files with 12 additions and 3 deletions

View File

@@ -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);
}
}
/*