Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
mutex protect Status to pacify the race detector
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Mar 2, 2019
1 parent d4f0f7f commit db5374f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autonat.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ func NewAutoNAT(ctx context.Context, h host.Host, getAddrs GetAddrs) AutoNAT {
}

func (as *AmbientAutoNAT) Status() NATStatus {
as.mx.Lock()
defer as.mx.Unlock()
return as.status
}

Expand Down

0 comments on commit db5374f

Please sign in to comment.