Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFloat64 ¶
func LoadFloat64(addr *AtomicFloat64) (val float64)
LoadFloat64 atomically loads tha float64 value from the provided address.
func StoreFloat64 ¶
func StoreFloat64(addr *AtomicFloat64, val float64)
StoreFloat64 atomically stores a float64 value into the provided address.
Types ¶
type AtomicFloat64 ¶
type AtomicFloat64 uint64
AtomicFloat64 mimics the atomic types in the sync/atomic standard library, but for the float64 type. If you'd like to implement additional methods, consider checking out the expvar Float type for guidance: https://golang.org/src/expvar/expvar.go?s=2188:2222#L69
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
A Mutex is a mutual exclusion lock.
func (*Mutex) AssertHeld ¶
func (m *Mutex) AssertHeld()
AssertHeld may panic if the mutex is not locked (but it is not required to do so). Functions which require that their callers hold a particular lock may use this to enforce this requirement more directly than relying on the race detector.
Note that we do not require the lock to be held by any particular thread, just that some thread holds the lock. This is both more efficient and allows for rare cases where a mutex is locked in one thread and used in another.
type RWMutex ¶
An RWMutex is a reader/writer mutual exclusion lock.
func (*RWMutex) AssertHeld ¶
func (m *RWMutex) AssertHeld()
AssertHeld may panic if the mutex is not locked for writing (but it is not required to do so). Functions which require that their callers hold a particular lock may use this to enforce this requirement more directly than relying on the race detector.
Note that we do not require the lock to be held by any particular thread, just that some thread holds the lock. This is both more efficient and allows for rare cases where a mutex is locked in one thread and used in another.