commit | 16b44f14f0990d358f2ba3191ff8e7c44c9f0bef | [log] [tgz] |
---|---|---|
author | Bill Fumerola <billf@uber.com> | Tue May 09 15:26:45 2017 -0700 |
committer | bill fumerola <billf@mu.org> | Wed Jul 19 18:44:22 2017 -0400 |
tree | 659c6bab74ab898f2229840d69abc06a78a49b54 | |
parent | 0506d69f5564c56e25797bf7183c28921d4c6360 [diff] |
Optimization for String.Store("")
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.