MCPcopy
hub / github.com/tailscale/tailscale / optionalPolicyLock

Struct optionalPolicyLock

util/syspolicy/source/policy_store_windows.go:485–488  ·  view source on GitHub ↗

optionalPolicyLock is a wrapper around [gp.PolicyLock] that locks and unlocks the underlying [gp.PolicyLock]. If the [gp.PolicyLock.Lock] returns [gp.ErrLockRestricted], the error is ignored, and calling [optionalPolicyLock.Unlock] is a no-op. The underlying GP lock is kinda optional: it is safe t

Source from the content-addressed store, hash-verified

483//
484// It is not safe for concurrent use.
485type optionalPolicyLock struct {
486 *gp.PolicyLock
487 state gpLockState
488}
489
490// Lock acquires the underlying [gp.PolicyLock], returning an error on failure.
491// If the lock cannot be acquired due to a restriction in place

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected