summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2008-04-27 08:18:12 (GMT)
committervasiljevic <zv@archiware.com>2008-04-27 08:18:12 (GMT)
commitde1bb7a14fd63e5fb0a20ea489dcba8e439937b7 (patch)
tree8850af7a395c615ea7716e32a9979dcecdceea38
parent27aec14d72c41ea56ffe2785d3a598a76f64c5db (diff)
downloadtcl-de1bb7a14fd63e5fb0a20ea489dcba8e439937b7.zip
tcl-de1bb7a14fd63e5fb0a20ea489dcba8e439937b7.tar.gz
tcl-de1bb7a14fd63e5fb0a20ea489dcba8e439937b7.tar.bz2
Also, panic early if we find out the wrong thread attempting
to delete the async handler (common trap). As, only the one that created the handler is allowed to delete it.
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclAsync.c10
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d0782c9..b1b5f59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@
to locate handler token fails. Happens when some other
thread attempts to delete somebody else's token.
+ Also, panic early if we find out the wrong thread attempting
+ to delete the async handler (common trap). As, only the one
+ that created the handler is allowed to delete it.
+
2008-04-17 Andreas Kupries <andreask@activestate.com>
*** 8.4.19 TAGGED FOR RELEASE ***
diff --git a/generic/tclAsync.c b/generic/tclAsync.c
index f036b47..9a78c8f 100644
--- a/generic/tclAsync.c
+++ b/generic/tclAsync.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclAsync.c,v 1.6.12.2 2008/04/26 11:37:47 vasiljevic Exp $
+ * RCS: @(#) $Id: tclAsync.c,v 1.6.12.3 2008/04/27 08:18:13 vasiljevic Exp $
*/
#include "tclInt.h"
@@ -294,6 +294,14 @@ Tcl_AsyncDelete(async)
AsyncHandler *prevPtr, *thisPtr;
/*
+ * Assure early handling of the constraint
+ */
+
+ if (asyncPtr->originThrdId != Tcl_GetCurrentThread()) {
+ panic("Tcl_AsyncDelete: async handler deleted by the wrong thread");
+ }
+
+ /*
* If we come to this point when TSD's for the current
* thread have already been garbage-collected, we are
* in the _serious_ trouble. OTOH, we tolerate calling