Documentation
¶
Overview ¶
Package atomics provides types that can be concurrently accessed and modified, without caller code needing to implement locking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
The AtomicBool is an atomic boolean, no need for locking which makes the code faster and simpler.
This interface is really just to abstract away the 0 or 1 value of an int32 modified using the sync/atomic package. Hopefully the go compiler will inline these methods so they'll be super fast.
func NewBool ¶
NewAtomicBool returns an AtomicBool initialized with value.
Note it is perfectly safe just declare an AtomicBool it defaults to false just like a normal boolean would do.
Click to show internal directories.
Click to hide internal directories.