diff options
author | Joe Mistachkin <joe@mistachkin.com> | 2009-10-18 08:00:40 (GMT) |
---|---|---|
committer | Joe Mistachkin <joe@mistachkin.com> | 2009-10-18 08:00:40 (GMT) |
commit | ced84e1de5cdbd9a1c6a9e1850ab53968facc2d6 (patch) | |
tree | f8b3fcf71e040dd7f6cb2a4bcc750b0d7deec2f7 | |
parent | e37850ab1c67a3e6c3b23fddc07afeaefd699994 (diff) | |
download | tcl-ced84e1de5cdbd9a1c6a9e1850ab53968facc2d6.zip tcl-ced84e1de5cdbd9a1c6a9e1850ab53968facc2d6.tar.gz tcl-ced84e1de5cdbd9a1c6a9e1850ab53968facc2d6.tar.bz2 |
Fix for [Bug 1565466]
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | tests/thread.test | 11 |
2 files changed, 15 insertions, 4 deletions
@@ -1,3 +1,11 @@ +2009-10-18 Joe Mistachkin <joe@mistachkin.com> + + * tests/thread.test (thread-4.[345]): [Bug 1565466]: Correct tests to + save their error state before the final call to threadReap just in case + it triggers an "invalid thread id" error. This error can occur if one + or more of the target threads has exited prior to the attempt to send + it an asynchronous exit command. + 2009-10-17 Donal K. Fellows <dkf@users.sf.net> * generic/tclVar.c (UnsetVarStruct, TclDeleteNamespaceVars) diff --git a/tests/thread.test b/tests/thread.test index be2bd40..15988bd 100644 --- a/tests/thread.test +++ b/tests/thread.test @@ -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: thread.test,v 1.20 2008/07/19 22:50:39 nijtmans Exp $ +# RCS: @(#) $Id: thread.test,v 1.21 2009/10/18 08:00:40 mistachkin Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -186,8 +186,9 @@ test thread-4.3 {TclThreadSend preserve errorInfo} {testthread} { set len [llength [testthread names]] set serverthread [testthread create] set x [catch {testthread send $serverthread {set undef}} msg] + set savedErrorInfo $::errorInfo threadReap - list $len $x $msg $::errorInfo + list $len $x $msg $savedErrorInfo } {1 1 {can't read "undef": no such variable} {can't read "undef": no such variable while executing "set undef" @@ -199,16 +200,18 @@ test thread-4.4 {TclThreadSend preserve code} {testthread} { set serverthread [testthread create] set ::errorInfo {} set x [catch {testthread send $serverthread {set ::errorInfo {}; break}} msg] + set savedErrorInfo $::errorInfo threadReap - list $len $x $msg $::errorInfo + list $len $x $msg $savedErrorInfo } {1 3 {} {}} test thread-4.5 {TclThreadSend preserve errorCode} {testthread} { threadReap set ::tcltest::mainThread [testthread names] set serverthread [testthread create] set x [catch {testthread send $serverthread {error ERR INFO CODE}} msg] + set savedErrorCode $::errorCode threadReap - list $x $msg $::errorCode + list $x $msg $savedErrorCode } {1 ERR CODE} |