ipn/ipnlocal: acquire b.mu once in Start

We used to Lock, Unlock, Lock, Unlock quite a few
times in Start resulting in all sorts of weird race
conditions. Simplify it all and only Lock/Unlock once.

Updates #11649

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2024-05-08 00:31:10 +00:00
committed by Maisem Ali
parent 9380e2dfc6
commit 32bc596062
3 changed files with 60 additions and 44 deletions

View File

@@ -43,7 +43,8 @@ type Client interface {
// Login begins an interactive or non-interactive login process.
// Client will eventually call the Status callback with either a
// LoginFinished flag (on success) or an auth URL (if further
// interaction is needed).
// interaction is needed). It merely sets the process in motion,
// and doesn't wait for it to complete.
Login(*tailcfg.Oauth2Token, LoginFlags)
// Logout starts a synchronous logout process. It doesn't return
// until the logout operation has been completed.