commit | bb9a8edc0f888f7dcda2e967c3409846a9d8475c | [log] [tgz] |
---|---|---|
author | alexeypavlenko <alex.gripav@gmail.com> | Thu Sep 27 19:07:59 2018 +0300 |
committer | Prashant Varanasi <github@prashantv.com> | Thu Sep 27 09:07:59 2018 -0700 |
tree | 1300ec8be4b83fdaa621a60b9cf620fb2c036eaa | |
parent | ca680462431f8c7f96686d91b1d9e5203c4b075b [diff] |
Introduce an atomic type-safe wrapper around error type. (#42)
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.