MCPcopy
hub / github.com/rqlite/rqlite / CheckAndSet

Struct CheckAndSet

internal/rsync/cas.go:21–26  ·  view source on GitHub ↗

CheckAndSet is a simple concurrency control mechanism that allows only one goroutine to execute a critical section at a time.

Source from the content-addressed store, hash-verified

19// CheckAndSet is a simple concurrency control mechanism that allows
20// only one goroutine to execute a critical section at a time.
21type CheckAndSet struct {
22 state bool
23 owner string
24 startT time.Time
25 mu sync.Mutex
26}
27
28// NewCheckAndSet creates a new CheckAndSet instance.
29func NewCheckAndSet() *CheckAndSet {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected