commit | 16e575a521a0ca0828d222accaa6b59c0074a85f | [log] [tgz] |
---|---|---|
author | Prashant Varanasi <github@prashantv.com> | Mon Jul 18 11:25:57 2016 -0700 |
committer | GitHub <noreply@github.com> | Mon Jul 18 11:25:57 2016 -0700 |
tree | c483abfc2580db320b8826889b6103b5ce576639 | |
parent | 3725100ae41f2a0dfbb85d3694143aa2c090657e [diff] | |
parent | d938bba9065a590d68c7ae0767f31d1696dd35e7 [diff] |
Merge pull request #9 from uber-go/string_bug Fix NewString disregarding the passed in string
Simple numeric wrappers to enforce atomic access.
go get -u github.com/uber-go/atomic
The standard library‘s sync/atomic
is powerful, but it’s easy to forget which variables must be accessed atomically. uber-go/atomic
preserves all the functionality of the standard library, but wraps the primitive numeric 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.