summaryrefslogtreecommitdiffstats
path: root/src/calendar.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-10-04 12:13:13 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-10-04 12:26:42 +0200
commit3aefd00f6aebad7c50210e68650cb8c42e0835cd (patch)
treed7fe18390e705c0288ac6cd3c2d3c66f13001b8f /src/calendar.c
parent4cd62fb0fba6ddb5c79e3d2dc109b5b7d98612e2 (diff)
downloadcalcurse-3aefd00f6aebad7c50210e68650cb8c42e0835cd.tar.gz
calcurse-3aefd00f6aebad7c50210e68650cb8c42e0835cd.zip
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>
Diffstat (limited to 'src/calendar.c')
-rw-r--r--src/calendar.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/calendar.c b/src/calendar.c
index 6664a93..e303ab9 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -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 */