From: Jason A. Donenfeld Date: Sun, 20 May 2018 03:55:52 +0000 (+0200) Subject: Avoid deadlock when the mutex isn't required, since these are atomics X-Git-Tag: 0.0.20180524~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e924e540764ec64cdf19f9b146a3c398da4d240;p=thirdparty%2Fwireguard-go.git Avoid deadlock when the mutex isn't required, since these are atomics Maybe this fixes the "double lock issue" in f73d2fb2d96bc3fbc8bc4cce452e3c19689de01e? --- 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) }