commit | 4e336646b2ef9fc6e47be8e21594178f98e5ebcf | [log] [tgz] |
---|---|---|
author | bill fumerola <billf@mu.org> | Mon Apr 10 19:30:53 2017 -0700 |
committer | GitHub <noreply@github.com> | Mon Apr 10 19:30:53 2017 -0700 |
tree | 6b378541dcfa1cae8c0b7bf8504320f3690f3d1a | |
parent | 1dcf4eb48319b17edb44c44955ee2617ae4ee895 [diff] |
Shadow atomic.Value from sync/atomic (#19)
Simple wrappers for primitive types to enforce atomic access.
go get -u go.uber.org/atomic
The standard library‘s sync/atomic
is powerful, but it’s easy to forget which variables must be accessed atomically. go.uber.org/atomic
preserves all the functionality of the standard library, but wraps the primitive types to provide a safer, more convenient API.
var atom atomic.Uint32
atom.Store(42)
atom.Sub(2)
atom.CAS(40, 11)
See the documentation for a complete API specification.
Stable.