Make used of typed atomic.Pointer (#23550)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2ac375b3fe
Коммит
7a9a098ce4
@@ -108,7 +108,7 @@ type WebConn struct {
|
||||
// leave that as an edge-case.
|
||||
reuseCount int
|
||||
sessionToken atomic.Value
|
||||
session atomic.Value
|
||||
session atomic.Pointer[model.Session]
|
||||
connectionID atomic.Value
|
||||
endWritePump chan struct{}
|
||||
pumpFinished chan struct{}
|
||||
@@ -304,7 +304,7 @@ func areAllInactive(conns []*WebConn) bool {
|
||||
|
||||
// GetSession returns the session of the connection.
|
||||
func (wc *WebConn) GetSession() *model.Session {
|
||||
return wc.session.Load().(*model.Session)
|
||||
return wc.session.Load()
|
||||
}
|
||||
|
||||
// SetSession sets the session of the connection.
|
||||
|
||||
Ссылка в новой задаче
Block a user