From 06831f3ce25bb5b9778c4de1ad35dd50ed6b7b32 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 21 Mar 2016 12:08:34 +0000 Subject: (cherry-pick): Fix [d3071887dbc7aeac]: Fix SEGV in Tcl_FinalizeNotifier(). Thanks to hirofumi for both the bug-report and the fix --- unix/tclUnixNotfy.c | 2 ++ 1 file changed, 2 insertions(+) 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(¬ifierMutex); while(triggerPipe != -1) { pthread_cond_wait(¬ifierCV, ¬ifierMutex); } + pthread_mutex_unlock(¬ifierMutex); if (notifierThreadRunning) { int result = pthread_join((pthread_t) notifierThread, NULL); -- cgit v0.12