]> Cypherpunks repositories - gostls13.git/commit
net/http: change conn.curReq type to atomic.Pointer[response]
authorLudi Rehak <ludi317@gmail.com>
Wed, 3 Aug 2022 20:48:15 +0000 (13:48 -0700)
committerThan McIntosh <thanm@google.com>
Mon, 8 Aug 2022 16:01:12 +0000 (16:01 +0000)
commitadac8acf881ac48c558a4873b4cc7551c7e592b1
treed4a06c8161f49f7f522580e5c0a9f8c29a548cb9
parent0581d69dc6e67734293ba0c10b63df640a457aab
net/http: change conn.curReq type to atomic.Pointer[response]

Use the newly added atomic.Pointer[T] type for atomically
loading and storing type *T pointers. This has the advantage of
avoiding runtime type assertions required by its predecessor,
atomic.Value.

To fix build failures uncovered by TryBots (caused by "panic:
unaligned 64-bit atomic operation"), also change conn.curState to
type atomic.Uint64 so that it is 64-bit aligned.

Change-Id: I6024d12cd581adfdccc01be7eb0faa7482036614
Reviewed-on: https://go-review.googlesource.com/c/go/+/420901
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/server.go