summaryrefslogtreecommitdiffhomepage
path: root/util/syspolicy
diff options
context:
space:
mode:
Diffstat (limited to 'util/syspolicy')
-rw-r--r--util/syspolicy/rsop/change_callbacks.go3
-rw-r--r--util/syspolicy/rsop/resultant_policy.go2
-rw-r--r--util/syspolicy/rsop/rsop.go5
-rw-r--r--util/syspolicy/setting/setting.go5
4 files changed, 13 insertions, 2 deletions
diff --git a/util/syspolicy/rsop/change_callbacks.go b/util/syspolicy/rsop/change_callbacks.go
index 71135bb2a..fdf51c253 100644
--- a/util/syspolicy/rsop/change_callbacks.go
+++ b/util/syspolicy/rsop/change_callbacks.go
@@ -9,7 +9,6 @@ import (
"sync"
"time"
- "tailscale.com/syncs"
"tailscale.com/util/set"
"tailscale.com/util/syspolicy/internal/loggerx"
"tailscale.com/util/syspolicy/pkey"
@@ -71,7 +70,7 @@ func (c PolicyChange) HasChangedAnyOf(keys ...pkey.Key) bool {
// policyChangeCallbacks are the callbacks to invoke when the effective policy changes.
// It is safe for concurrent use.
type policyChangeCallbacks struct {
- mu syncs.Mutex
+ mu sync.Mutex
cbs set.HandleSet[PolicyChangeCallback]
}
diff --git a/util/syspolicy/rsop/resultant_policy.go b/util/syspolicy/rsop/resultant_policy.go
index bdda90976..67e13ab56 100644
--- a/util/syspolicy/rsop/resultant_policy.go
+++ b/util/syspolicy/rsop/resultant_policy.go
@@ -96,6 +96,8 @@ func newPolicy(scope setting.PolicyScope, sources ...*source.Source) (_ *Policy,
closeCh: make(chan struct{}),
doneCh: make(chan struct{}),
}
+ syncs.RegisterMutex(&p.mu, "syspolicy/rsop.Policy.mu")
+
if _, err := p.reloadNow(false); err != nil {
p.Close()
return nil, err
diff --git a/util/syspolicy/rsop/rsop.go b/util/syspolicy/rsop/rsop.go
index 333dca643..d7e50a004 100644
--- a/util/syspolicy/rsop/rsop.go
+++ b/util/syspolicy/rsop/rsop.go
@@ -32,6 +32,11 @@ var (
effectivePolicyLRU [setting.NumScopes]syncs.AtomicValue[*Policy]
)
+var _ = func() bool {
+ syncs.RegisterMutex(&policyMu, "syspolicy/rsop.policyMu")
+ return true
+}()
+
// PolicyFor returns the [Policy] for the specified scope,
// creating it from the registered [source.Store]s if it doesn't already exist.
func PolicyFor(scope setting.PolicyScope) (*Policy, error) {
diff --git a/util/syspolicy/setting/setting.go b/util/syspolicy/setting/setting.go
index 97362b1dc..d0df2436c 100644
--- a/util/syspolicy/setting/setting.go
+++ b/util/syspolicy/setting/setting.go
@@ -220,6 +220,11 @@ var (
definitionsUsed bool
)
+var _ = func() bool {
+ syncs.RegisterMutex(&definitionsMu, "syspolicy/setting.definitionsMu")
+ return true
+}()
+
// Register registers a policy setting with the specified key, scope, value type,
// and an optional list of supported platforms. All policy settings must be
// registered before any of them can be used. Register panics if called after