]> Cypherpunks repositories - gostls13.git/commit
net: support context cancellation in acquireThread
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Wed, 21 Feb 2024 17:18:43 +0000 (17:18 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 21 Feb 2024 18:47:20 +0000 (18:47 +0000)
commitc07b9b00361b9a99fc64ffe36f897d24954f99cf
tree694ee8150c33fa3acafc85b6c3071395f81383d2
parentcd17032721425f1e131f3c19801c6e66972d4b6c
net: support context cancellation in acquireThread

acquireThread is already waiting on a channel, so
it can be easily wired up to support context cancellation.
This change will make sure that contexts that are
cancelled at the acquireThread stage (when the limit of
threads is reached) do not queue unnecessarily and cause
an unnecessary cgo call that will be soon aborted by
the doBlockingWithCtx function.

Updates #63978

Change-Id: I8ae4debd51995637567d8f51c6f1ed60f23d6c0c
GitHub-Last-Rev: 4189b9faf07c073a2ca440becee07b6aa9c4e795
GitHub-Pull-Request: golang/go#63985
Reviewed-on: https://go-review.googlesource.com/c/go/+/539360
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/cgo_unix.go
src/net/lookup_windows.go
src/net/net.go