Home | History | Annotate | Download | only in atomic

Lines Matching defs:Value

11 // A Value provides an atomic load and store of a consistently typed value.
12 // The zero value for a Value returns nil from Load.
13 // Once Store has been called, a Value must not be copied.
15 // A Value must not be copied after first use.
16 type Value struct {
26 // Load returns the value set by the most recent Store.
27 // It returns nil if there has been no call to Store for this Value.
28 func (v *Value) Load() (x interface{}) {
42 // Store sets the value of the Value to x.
43 // All calls to Store for a given Value must use values of the same concrete type.
45 func (v *Value) Store(x interface{}) {
47 panic("sync/atomic: store of nil value into Value")
77 panic("sync/atomic: store of inconsistently typed value into Value")