diff options
| author | Sonia Appasamy <sonia@tailscale.com> | 2023-08-28 13:15:19 -0400 |
|---|---|---|
| committer | Sonia Appasamy <sonia@tailscale.com> | 2023-08-28 13:15:39 -0400 |
| commit | 25924fbce2d24bbf70639714f9253e5043f3c822 (patch) | |
| tree | 53e92bd7a1d7bdcf94d5e110fe6bbb2007995ad0 | |
| parent | c86a610eb30ebe8402557b6c8eb04a80ce1e5ae3 (diff) | |
| download | tailscale-soniaappasamy/fix-web-client-lock.tar.xz tailscale-soniaappasamy/fix-web-client-lock.zip | |
client/web: fix lock/unlock order when updating s.selfsoniaappasamy/fix-web-client-lock
Updates tailscale/corp#13775
Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
| -rw-r--r-- | client/web/web.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/web/web.go b/client/web/web.go index f18e83deb..3b9f62011 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -160,10 +160,10 @@ func (s *Server) watchSelf(ctx context.Context) { // updateSelf grabs the lock and updates s.self. // Then logs if anything changed. func (s *Server) updateSelf(self tailcfg.NodeView) { - s.selfMu.Lock() + s.selfMu.Unlock() prev := s.self s.self = self - s.selfMu.Unlock() + s.selfMu.Lock() var old, new tailcfg.StableNodeID if prev.Valid() { |
