summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2005-05-31 08:18:31 (GMT)
committervasiljevic <zv@archiware.com>2005-05-31 08:18:31 (GMT)
commit323b868f7dfe5140b031b9bf17ad691d722e23b0 (patch)
tree4f2825c2593d71b2d5cd73be6cb8aa04f378830a
parent6b46a57162508aa2b627ad5dc9664be0ba1b44f0 (diff)
downloadtcl-323b868f7dfe5140b031b9bf17ad691d722e23b0.zip
tcl-323b868f7dfe5140b031b9bf17ad691d722e23b0.tar.gz
tcl-323b868f7dfe5140b031b9bf17ad691d722e23b0.tar.bz2
Notifier thread is created as joinable. Attempt to solve the
Tcl Bug #1082283.
-rw-r--r--unix/tclUnixNotfy.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index d44144c..f4368c5 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixNotfy.c,v 1.11.2.9 2005/05/14 20:52:33 das Exp $
+ * RCS: @(#) $Id: tclUnixNotfy.c,v 1.11.2.10 2005/05/31 08:18:31 vasiljevic Exp $
*/
#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier
@@ -222,7 +222,7 @@ Tcl_InitNotifier()
Tcl_MutexLock(&notifierMutex);
if (notifierCount == 0) {
if (TclpThreadCreate(&notifierThread, NotifierThreadProc, NULL,
- TCL_THREAD_STACK_DEFAULT, TCL_THREAD_NOFLAGS) != TCL_OK) {
+ TCL_THREAD_STACK_DEFAULT, TCL_THREAD_JOINABLE) != TCL_OK) {
panic("Tcl_InitNotifier: unable to start notifier thread");
}
}
@@ -275,11 +275,12 @@ Tcl_FinalizeNotifier(clientData)
*/
if (notifierCount == 0) {
+ int result;
if (triggerPipe < 0) {
panic("Tcl_FinalizeNotifier: notifier pipe not initialized");
}
- /*
+ /*
* Send "q" message to the notifier thread so that it will
* terminate. The notifier will return from its call to select()
* and notice that a "q" message has arrived, it will then close
@@ -293,6 +294,10 @@ Tcl_FinalizeNotifier(clientData)
close(triggerPipe);
Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
+ result = Tcl_JoinThread(notifierThread);
+ if (result) {
+ Tcl_Panic("Tcl_FinalizeNotifier: unable to join notifier thread");
+ }
}
/*