Fix data races in timers
This commit is contained in:
parent
18f43705ec
commit
acb5481246
4 changed files with 17 additions and 17 deletions
2
send.go
2
send.go
|
|
@ -124,7 +124,7 @@ func (peer *Peer) SendKeepalive() bool {
|
|||
|
||||
func (peer *Peer) SendHandshakeInitiation(isRetry bool) error {
|
||||
if !isRetry {
|
||||
peer.timers.handshakeAttempts = 0
|
||||
atomic.StoreUint32(&peer.timers.handshakeAttempts, 0)
|
||||
}
|
||||
|
||||
peer.handshake.mutex.RLock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue