summaryrefslogtreecommitdiffhomepage
path: root/wgengine/userspace.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2025-12-02 12:50:33 -0800
committerBrad Fitzpatrick <bradfitz@tailscale.com>2025-12-02 15:12:13 -0800
commit381de776c4878dd9af76b126cfa37bc80cad363f (patch)
treec3ddcbf9613db3074c9c6882bb757357cf5bdd0a /wgengine/userspace.go
parentb8c58ca7c1a49fb772d095c65693cdab06488047 (diff)
downloadtailscale-bradfitz/mutex_debug.tar.xz
tailscale-bradfitz/mutex_debug.zip
syncs: start working on mutex debugging, registrationbradfitz/mutex_debug
Updates #17852 Change-Id: Ib1b634eedd30cc4006bc1b39aa8d479d37c5f1f2 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'wgengine/userspace.go')
-rw-r--r--wgengine/userspace.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/wgengine/userspace.go b/wgengine/userspace.go
index 1b8562d3f..7e48e3967 100644
--- a/wgengine/userspace.go
+++ b/wgengine/userspace.go
@@ -17,7 +17,6 @@ import (
"runtime"
"slices"
"strings"
- "sync"
"time"
"github.com/tailscale/wireguard-go/device"
@@ -130,7 +129,7 @@ type userspaceEngine struct {
// is being routed over Tailscale.
isDNSIPOverTailscale syncs.AtomicValue[func(netip.Addr) bool]
- wgLock sync.Mutex // serializes all wgdev operations; see lock order comment below
+ wgLock syncs.Mutex // serializes all wgdev operations; see lock order comment below
lastCfgFull wgcfg.Config
lastNMinPeers int
lastRouter *router.Config
@@ -145,7 +144,7 @@ type userspaceEngine struct {
lastStatusPollTime mono.Time // last time we polled the engine status
reconfigureVPN func() error // or nil
- mu sync.Mutex // guards following; see lock order comment below
+ mu syncs.Mutex // guards following; see lock order comment below
netMap *netmap.NetworkMap // or nil
closing bool // Close was called (even if we're still closing)
statusCallback StatusCallback
@@ -361,6 +360,9 @@ func NewUserspaceEngine(logf logger.Logf, conf Config) (_ Engine, reterr error)
reconfigureVPN: conf.ReconfigureVPN,
health: conf.HealthTracker,
}
+ syncs.RegisterMutex(&e.mu, "wgengine.userspaceEngine.mu")
+ syncs.RegisterMutex(&e.wgLock, "wgengine.userspaceEngine.wgLock")
+ e.networkLogger.RegisterMutex()
if e.birdClient != nil {
// Disable the protocol at start time.