From 5e924e540764ec64cdf19f9b146a3c398da4d240 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 20 May 2018 05:55:52 +0200 Subject: [PATCH] Avoid deadlock when the mutex isn't required, since these are atomics Maybe this fixes the "double lock issue" in f73d2fb2d96bc3fbc8bc4cce452e3c19689de01e? --- device.go | 4 ---- 1 file changed, 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) }