summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-09-12 00:41:44 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-09-12 00:41:44 (GMT)
commita0baa7a37e79abe06322069bef4fa706950a4b18 (patch)
tree24a7f17a08df4253f28ef5c8b0b3c4c90eacd236
parent0316c6eff20ff2d18f2b47d72f9d83fa497d5731 (diff)
downloadtcl-a0baa7a37e79abe06322069bef4fa706950a4b18.zip
tcl-a0baa7a37e79abe06322069bef4fa706950a4b18.tar.gz
tcl-a0baa7a37e79abe06322069bef4fa706950a4b18.tar.bz2
Convert [testthread] use to Thread package use in thread-6.1.
Eliminates a memory leak in `make valgrind`.
-rw-r--r--ChangeLog3
-rw-r--r--tests/thread.test15
2 files changed, 9 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ddc913..ea86aec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2011-09-11 Don Porter <dgp@users.sourceforge.net>
+ * tests/thread.test: Convert [testthread] use to Thread package
+ use in thread-6.1. Eliminates a memory leak in `make valgrind`.
+
* tests/socket.test: [Bug 3390699]: Convert [testthread] use to
Thread package use in socket_*-13.1. Eliminates a memory leak in
`make valgrind`.
diff --git a/tests/thread.test b/tests/thread.test
index a6961ed..db28dc9 100644
--- a/tests/thread.test
+++ b/tests/thread.test
@@ -19,6 +19,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
# Some tests require the testthread command
testConstraint testthread [expr {[info commands testthread] != {}}]
+testConstraint thread [expr {0 == [catch {package require Thread 2.6}]}]
if {[testConstraint testthread]} {
testthread errorproc ThreadError
@@ -239,22 +240,18 @@ test thread-5.2 {Try to join a detached thread} {testthread} {
lrange $msg 0 2
} {cannot join thread}
-test thread-6.1 {freeing very large object trees in a thread} testthread {
+test thread-6.1 {freeing very large object trees in a thread} thread {
# conceptual duplicate of obj-32.1
- threadReap
- set serverthread [testthread create -joinable]
- testthread send -async $serverthread {
+ set serverthread [thread::create -preserved]
+ thread::send -async $serverthread {
set x {}
for {set i 0} {$i<100000} {incr i} {
set x [list $x {}]
}
unset x
- testthread exit
}
- catch {set res [testthread join $serverthread]} msg
- threadReap
- set res
-} {0}
+ thread::release -wait $serverthread
+} 0
# TIP #285: Script cancellation support
test thread-7.1 {cancel: args} {testthread} {