summaryrefslogtreecommitdiffhomepage
path: root/device.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-20 05:55:52 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-20 06:29:21 +0200
commit5e924e540764ec64cdf19f9b146a3c398da4d240 (patch)
tree8562b6e1e8c555f801608197229ef96e0a680ef8 /device.go
parentb290cf05e3fce351fd44f99c4f01c201a060305a (diff)
Avoid deadlock when the mutex isn't required, since these are atomics
Maybe this fixes the "double lock issue" in f73d2fb2d96bc3fbc8bc4cce452e3c19689de01e?
Diffstat (limited to 'device.go')
-rw-r--r--device.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/device.go b/device.go
index 53e7dcc..6758cbc 100644
--- a/device.go
+++ b/device.go
@@ -162,16 +162,12 @@ func (device *Device) Up() {
return
}
- device.state.mutex.Lock()
device.isUp.Set(true)
- device.state.mutex.Unlock()
deviceUpdateState(device)
}
func (device *Device) Down() {
- device.state.mutex.Lock()
device.isUp.Set(false)
- device.state.mutex.Unlock()
deviceUpdateState(device)
}