From 1b15349e011a14a54e1a0b0f613df47bb2898d6f Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Wed, 15 Sep 2021 12:59:47 -0700 Subject: [PATCH] ipn/ipnlocal: remove locks around sync.Cond.Broadcast call They are unnecessary. Signed-off-by: Josh Bleecher Snyder --- ipn/ipnlocal/local.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 8bee8f815..7e2431f61 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -601,18 +601,12 @@ func (b *LocalBackend) findExitNodeIDLocked(nm *netmap.NetworkMap) (prefsChanged func (b *LocalBackend) setWgengineStatus(s *wgengine.Status, err error) { if err != nil { b.logf("wgengine status error: %v", err) - - b.statusLock.Lock() b.statusChanged.Broadcast() - b.statusLock.Unlock() return } if s == nil { b.logf("[unexpected] non-error wgengine update with status=nil: %v", s) - - b.statusLock.Lock() b.statusChanged.Broadcast() - b.statusLock.Unlock() return } @@ -632,11 +626,7 @@ func (b *LocalBackend) setWgengineStatus(s *wgengine.Status, err error) { } b.stateMachine() } - - b.statusLock.Lock() b.statusChanged.Broadcast() - b.statusLock.Unlock() - b.send(ipn.Notify{Engine: &es}) }