Skip to content

Commit

Permalink
fix CAS
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Nov 7, 2023
1 parent 4ec2ee9 commit ce10101
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/conn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ func (c *conn) SetState(s State) State {
}

func (c *conn) setState(s State) State {
state := c.state.Load()
if c.state.CompareAndSwap(state, uint32(s)) {
if state := State(c.state.Swap(uint32(s))); state != s {
trace.DriverOnConnStateChange(
c.config.Trace(),
c.endpoint.Copy(),
Expand Down

0 comments on commit ce10101

Please sign in to comment.