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:
@@ -145,7 +145,10 @@ void
|
||||
calendar_stop_date_thread (void)
|
||||
{
|
||||
if (calendar_t_date)
|
||||
pthread_cancel (calendar_t_date);
|
||||
{
|
||||
pthread_cancel (calendar_t_date);
|
||||
pthread_join (calendar_t_date, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set static variable today to current date */
|
||||
|
||||
Reference in New Issue
Block a user