summaryrefslogtreecommitdiffstats
path: root/tests/http.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-09-16 08:12:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-09-16 08:12:48 (GMT)
commit679c72e5a2c14ab53b227e058c4ef06edde6b7a4 (patch)
treeb28a3a30c684e4377f39e18d3b4689891cab876b /tests/http.test
parentfe0e5c84250f9e45fcbf320d121a961c767b3b5a (diff)
parentef09f86d39a751b46143aa33f2ee808b31a6a984 (diff)
downloadtcl-tip_388_impl.zip
tcl-tip_388_impl.tar.gz
tcl-tip_388_impl.tar.bz2
merge trunk to feature branchtip_388_impl
Diffstat (limited to 'tests/http.test')
-rw-r--r--tests/http.test19
1 files changed, 8 insertions, 11 deletions
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
}