summaryrefslogtreecommitdiffhomepage
path: root/device/peer.go
diff options
context:
space:
mode:
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