Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.32 KB

README.md

File metadata and controls

55 lines (39 loc) · 1.32 KB

atomix

build-img pkg-img version-img

Better sync/atomic package for Go.

Rationale

To make life easier with sync/atomic this package provide wrappers and helper functions, so all the atomic data and operations are easily visible.

Note

For the better sync package see synx.

Features

  • All primitive types and more
    • int8, int16, int32, int64
    • uint8, uint16, uint32, uint64`
    • float32, float64, complex64 and int
    • string, interface{} and error
    • uintptr, unsafe.Pointer
    • time.Time, time.Duration
  • Zero cpu and memory overhead in almost all cases.
  • Useful helpers.

See docs.

Install

go get github.com/cristalhq/atomix

Example

var a atomix.Int32
a.Store(1335)
a.Add(2)
b := a.Load() // 1337

License

MIT License.