Better sync/atomic
package for Go.
To make life easier with sync/atomic
this package provide wrappers and helper functions, so all the atomic data and operations are easily visible.
For the better sync
package see synx.
- All primitive types and more
int8
,int16
,int32
,int64
uint8
,uint16
, uint32,
uint64`float32
,float64
,complex64
andint
string
,interface{}
anderror
uintptr
,unsafe.Pointer
time.Time
,time.Duration
- Zero cpu and memory overhead in almost all cases.
- Useful helpers.
See docs.
go get github.com/cristalhq/atomix
var a atomix.Int32
a.Store(1335)
a.Add(2)
b := a.Load() // 1337