commit | d938bba9065a590d68c7ae0767f31d1696dd35e7 | [log] [tgz] |
---|---|---|
author | Prashant Varanasi <prashant@uber.com> | Mon Jul 18 11:07:34 2016 -0700 |
committer | Prashant Varanasi <prashant@uber.com> | Mon Jul 18 11:07:34 2016 -0700 |
tree | c483abfc2580db320b8826889b6103b5ce576639 | |
parent | 3725100ae41f2a0dfbb85d3694143aa2c090657e [diff] |
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.