diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-10-04 12:13:13 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-10-04 12:26:42 +0200 |
commit | 3aefd00f6aebad7c50210e68650cb8c42e0835cd (patch) | |
tree | d7fe18390e705c0288ac6cd3c2d3c66f13001b8f /src/io.c | |
parent | 4cd62fb0fba6ddb5c79e3d2dc109b5b7d98612e2 (diff) | |
download | 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/io.c')
-rw-r--r-- | src/io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); + } } /* |