Skip to content
Wrapper types for sync/atomic which enforce atomic access
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add docs and linters before release (#6) May 30, 2016
scripts Fix Go tip errors with self-import (#14) Oct 27, 2016
.codecov.yml
.gitignore
.travis.yml Simplify lint version select, control via .travis.yml (#46) Feb 26, 2019
LICENSE.txt
Makefile Simplify lint version select, control via .travis.yml (#46) Feb 26, 2019
README.md
atomic.go
atomic_test.go
error.go
error_test.go
example_test.go
glide.lock Use go.uber.org import path (#13) Oct 27, 2016
glide.yaml
stress_test.go
string.go
string_test.go

README.md

atomic GoDoc Build Status Coverage Status Go Report Card

Simple wrappers for primitive types to enforce atomic access.

Installation

go get -u go.uber.org/atomic

Usage

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.

Development Status

Stable.


Released under the MIT License.

You can’t perform that action at this time.