MCPcopy
hub / github.com/redis/go-redis / AtomicMin

Struct AtomicMin

internal/util/atomic_min.go:22–29  ·  view source on GitHub ↗

AtomicMin is a thread-safe Min container - hasValue indicator true if a value was equal to or greater than threshold - optional threshold for minimum accepted Min value - — - wait-free CompareAndSwap mechanic

Source from the content-addressed store, hash-verified

20// - —
21// - wait-free CompareAndSwap mechanic
22type AtomicMin struct {
23
24 // value is current Min
25 value atomic.Float64
26 // whether [AtomicMin.Value] has been invoked
27 // with value equal or greater to threshold
28 hasValue atomic.Bool
29}
30
31// NewAtomicMin returns a thread-safe Min container
32// - if threshold is not used, AtomicMin is initialization-free

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected