From a816e8511eb45975e8e0e4199c3481989953fd56 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 9 Feb 2021 15:35:43 +0100 Subject: device: fix comment typo and shorten state.mu.Lock to state.Lock Signed-off-by: Jason A. Donenfeld --- device/peer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'device/peer.go') 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 -- cgit v1.2.3