summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-21 12:03:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-21 12:03:17 (GMT)
commit40986d0eb9b2abc7fcdfecd71609df01902941b6 (patch)
tree7e61fe4a44865725423b47f70fb3238e4f2beb5f /unix
parent5cf8d7d5dcebf2813aab714174598afc6587a3f5 (diff)
downloadtcl-40986d0eb9b2abc7fcdfecd71609df01902941b6.zip
tcl-40986d0eb9b2abc7fcdfecd71609df01902941b6.tar.gz
tcl-40986d0eb9b2abc7fcdfecd71609df01902941b6.tar.bz2
(cherry-pick): Fix [d3071887dbc7aeac]: Fix SEGV in Tcl_FinalizeNotifier(). Thanks to hirofumi for both the bug-report and the fix
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixNotfy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 48ba0cc..1457890 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -433,9 +433,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);