Skip to content

Commit 0cfe5ce

Browse files
authored
Do not migrate tasks to a different thread pool (backport of #1159) (#1206)
1 parent 3a79e9a commit 0cfe5ce

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "HTTP"
22
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
33
authors = ["Jacob Quinn", "contributors: https://github.com/JuliaWeb/HTTP.jl/graphs/contributors"]
4-
version = "1.9.18"
4+
version = "1.9.19"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -22,7 +22,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
2222

2323
[compat]
2424
CodecZlib = "0.7"
25-
ConcurrentUtilities = "2.2"
25+
ConcurrentUtilities = "2.4"
2626
ExceptionUnwrapping = "0.1"
2727
LoggingExtras = "0.4.9,1"
2828
MbedTLS = "0.6.8, 0.7, 1"

src/clientlayers/StreamRequest.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module StreamRequest
33
using ..IOExtras, ..Messages, ..Streams, ..Connections, ..Strings, ..RedirectRequest, ..Exceptions
44
using LoggingExtras, CodecZlib, URIs
55
using SimpleBufferStream: BufferStream
6+
using ConcurrentUtilities: @samethreadpool_spawn
67

78
export streamlayer
89

@@ -36,7 +37,7 @@ function streamlayer(stream::Stream; iofunction=nothing, decompress::Union{Nothi
3637
# use a lock here for request.context changes (this is currently the only places
3738
# where multiple threads may modify/change context at the same time)
3839
lock = ReentrantLock()
39-
Threads.@spawn try
40+
@samethreadpool_spawn try
4041
writebody(stream, req, lock)
4142
finally
4243
Base.@lock lock begin
@@ -46,7 +47,7 @@ function streamlayer(stream::Stream; iofunction=nothing, decompress::Union{Nothi
4647
closewrite(stream)
4748
end
4849
read_start = time()
49-
Threads.@spawn try
50+
@samethreadpool_spawn try
5051
@debugv 2 "client startread"
5152
startread(stream)
5253
if !isaborted(stream)

0 commit comments

Comments
 (0)