summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-21 12:08:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-21 12:08:34 (GMT)
commit06831f3ce25bb5b9778c4de1ad35dd50ed6b7b32 (patch)
tree780704fdab4f1f55cb491d54abc731741432e2ea
parent6b63d42886b68cbfdbd19c6fee04b836320a646d (diff)
downloadtcl-06831f3ce25bb5b9778c4de1ad35dd50ed6b7b32.zip
tcl-06831f3ce25bb5b9778c4de1ad35dd50ed6b7b32.tar.gz
tcl-06831f3ce25bb5b9778c4de1ad35dd50ed6b7b32.tar.bz2
(cherry-pick): Fix [d3071887dbc7aeac]: Fix SEGV in Tcl_FinalizeNotifier(). Thanks to hirofumi for both the bug-report and the fix
-rw-r--r--unix/tclUnixNotfy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index a57a89a..e7ea7a1 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -432,9 +432,11 @@ Tcl_FinalizeNotifier(
"unable to write q to triggerPipe");
}
close(triggerPipe);
+ pthread_mutex_lock(&notifierMutex);
while(triggerPipe != -1) {
pthread_cond_wait(&notifierCV, &notifierMutex);
}
+ pthread_mutex_unlock(&notifierMutex);
if (notifierThreadRunning) {
int result = pthread_join((pthread_t) notifierThread, NULL);