summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-09-02 16:33:50 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-09-02 16:33:50 (GMT)
commit68317f28895f8fcb2972916e1190498550d662af (patch)
tree464be31beef01ee147f02f5e21bcd01f8796649d
parent9d11f87f176b6d4318a556e83316e338759a426a (diff)
downloadtcl-68317f28895f8fcb2972916e1190498550d662af.zip
tcl-68317f28895f8fcb2972916e1190498550d662af.tar.gz
tcl-68317f28895f8fcb2972916e1190498550d662af.tar.bz2
Convert [testthread] use to Thread package use in http.test.
Eliminates memory leak seen in `make valgrind`.
-rw-r--r--ChangeLog5
-rw-r--r--tests/http.test19
2 files changed, 13 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index a5bac84..9b78a78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-02 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/http.test: Convert [testthread] use to Thread package use.
+ Eliminates memory leak seen in `make valgrind`.
+
2011-09-01 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
* unix/tclUnixSock.c: [Bug 3401422] Cache script-level changes to
diff --git a/tests/http.test b/tests/http.test
index 1f4d8b4..e6e7649 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -51,14 +51,13 @@ if {![file exists $httpdFile]} {
set removeHttpd 1
}
-if {[info commands testthread] == "testthread" && [file exists $httpdFile]} {
- set httpthread [testthread create "
- source [list $httpdFile]
- testthread wait
- "]
- testthread send $httpthread [list set port $port]
- testthread send $httpthread [list set bindata $bindata]
- testthread send $httpthread {httpd_init $port}
+catch {package require Thread 2.6}
+if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} {
+ set httpthread [thread::create -preserved]
+ thread::send $httpthread [list source $httpdFile]
+ thread::send $httpthread [list set port $port]
+ thread::send $httpthread [list set bindata $bindata]
+ thread::send $httpthread {httpd_init $port}
puts "Running httpd in thread $httpthread"
} else {
if {![file exists $httpdFile]} {
@@ -590,9 +589,7 @@ catch {unset badurl}
catch {unset port}
catch {unset data}
if {[info exists httpthread]} {
- testthread send -async $httpthread {
- testthread exit
- }
+ thread::release $httpthread
} else {
close $listen
}