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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user