summaryrefslogtreecommitdiffstats
path: root/tests/http.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-27 21:02:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-27 21:02:32 (GMT)
commit63b8879b8360fd38581a053cb4d53ba4fa4bf409 (patch)
treed0c0f737201fea4c31fa35b46b9ea174d3990566 /tests/http.test
parent6de2b2c1d639ec54c557ae563819bbcaf9ebd81e (diff)
parentc74a13788aa580ddc5a191f22096fb0a2758d41d (diff)
downloadtcl-63b8879b8360fd38581a053cb4d53ba4fa4bf409.zip
tcl-63b8879b8360fd38581a053cb4d53ba4fa4bf409.tar.gz
tcl-63b8879b8360fd38581a053cb4d53ba4fa4bf409.tar.bz2
Merge 8.7
Diffstat (limited to 'tests/http.test')
-rw-r--r--tests/http.test7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/http.test b/tests/http.test
index 9986a77..992fac5 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -46,6 +46,7 @@ if {![file exists $httpdFile]} {
catch {package require Thread 2.7-}
if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} {
set httpthread [thread::create -preserved]
+ lappend threadStack [list thread::release $httpthread]
thread::send $httpthread [list source $httpdFile]
thread::send $httpthread [list set bindata $bindata]
thread::send $httpthread {httpd_init 0; set port} port
@@ -63,6 +64,7 @@ if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} {
catch {unset port}
return
}
+ set threadStack {}
}
if {![info exists ThreadLevel]} {
@@ -77,6 +79,7 @@ if {![info exists ThreadLevel]} {
foreach ThreadLevel $ValueRange {
source [info script]
}
+ try [lpop threadStack]
catch {unset ThreadLevel}
catch {unset ValueRange}
return
@@ -1167,8 +1170,8 @@ catch {unset url}
catch {unset badurl}
catch {unset port}
catch {unset data}
-if {[info exists httpthread]} {
- thread::release $httpthread
+if {[llength $threadStack]} {
+ try [lpop threadStack]
} else {
close $listen
}