diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-20 05:55:52 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-20 06:29:21 +0200 |
commit | 5e924e540764ec64cdf19f9b146a3c398da4d240 (patch) | |
tree | 8562b6e1e8c555f801608197229ef96e0a680ef8 /device.go | |
parent | b290cf05e3fce351fd44f99c4f01c201a060305a (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.go | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -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) } |