aboutsummaryrefslogtreecommitdiffstats
path: root/device/peer.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-02-09 15:35:43 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-09 15:37:04 +0100
commita816e8511eb45975e8e0e4199c3481989953fd56 (patch)
tree5adc262690d21d7a22b8db3cce9cc4778d9808e9 /device/peer.go
parentdevice: fix typo in comment (diff)
downloadwireguard-go-a816e8511eb45975e8e0e4199c3481989953fd56.tar.xz
wireguard-go-a816e8511eb45975e8e0e4199c3481989953fd56.zip
device: fix comment typo and shorten state.mu.Lock to state.Lock
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/peer.go')
-rw-r--r--device/peer.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/device/peer.go b/device/peer.go
index 69238a6..96481ee 100644
--- a/device/peer.go
+++ b/device/peer.go
@@ -52,7 +52,7 @@ type Peer struct {
}
state struct {
- mu sync.Mutex // protects against concurrent Start/Stop
+ sync.Mutex // protects against concurrent Start/Stop
}
queue struct {
@@ -161,8 +161,8 @@ func (peer *Peer) Start() {
}
// prevent simultaneous start/stop operations
- peer.state.mu.Lock()
- defer peer.state.mu.Unlock()
+ peer.state.Lock()
+ defer peer.state.Unlock()
if peer.isRunning.Get() {
return
@@ -242,8 +242,8 @@ func (peer *Peer) ExpireCurrentKeypairs() {
}
func (peer *Peer) Stop() {
- peer.state.mu.Lock()
- defer peer.state.mu.Unlock()
+ peer.state.Lock()
+ defer peer.state.Unlock()
if !peer.isRunning.Swap(false) {
return