• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H11-Apr-2017-

scripts/H11-Apr-2017-

.gitignoreH A D11-Apr-201790

.travis.ymlH A D11-Apr-2017292

MakefileH A D11-Apr-20171.5 KiB

README.mdH A D11-Apr-20171.1 KiB

atomic.goH A D11-Apr-20177.9 KiB

atomic_test.goH A D11-Apr-20175.5 KiB

example_test.goH A D11-Apr-20171.4 KiB

glide.lockH A D11-Apr-2017494

glide.yamlH A D11-Apr-2017117

stress_test.goH A D11-Apr-20172.7 KiB

string.goH A D11-Apr-20171.7 KiB

string_test.goH A D11-Apr-20171.6 KiB

README.md

1# atomic [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov]
2
3Simple wrappers for primitive types to enforce atomic access.
4
5## Installation
6`go get -u go.uber.org/atomic`
7
8## Usage
9The standard library's `sync/atomic` is powerful, but it's easy to forget which
10variables must be accessed atomically. `go.uber.org/atomic` preserves all the
11functionality of the standard library, but wraps the primitive types to
12provide a safer, more convenient API.
13
14```go
15var atom atomic.Uint32
16atom.Store(42)
17atom.Sub(2)
18atom.CAS(40, 11)
19```
20
21See the [documentation][doc] for a complete API specification.
22
23## Development Status
24Stable.
25
26<hr>
27Released under the [MIT License](LICENSE.txt).
28
29[doc-img]: https://godoc.org/github.com/uber-go/atomic?status.svg
30[doc]: https://godoc.org/go.uber.org/atomic
31[ci-img]: https://travis-ci.org/uber-go/atomic.svg?branch=master
32[ci]: https://travis-ci.org/uber-go/atomic
33[cov-img]: https://coveralls.io/repos/github/uber-go/atomic/badge.svg?branch=master
34[cov]: https://coveralls.io/github/uber-go/atomic?branch=master
35