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

..03-May-2022-

.github/H15-Jul-2021-7456

internal/H15-Jul-2021-527308

tools/H15-Jul-2021-6839

.codecov.ymlH A D15-Jul-2021881 2017

.gitignoreH A D15-Jul-2021134 1612

CHANGELOG.mdH A D15-Jul-20213 KiB10168

MakefileH A D15-Jul-20212.1 KiB8059

README.mdH A D15-Jul-20212 KiB6445

assert_test.goH A D15-Jul-20211.7 KiB4615

bool.goH A D15-Jul-20212.3 KiB8239

bool_ext.goH A D15-Jul-20211.7 KiB5424

bool_test.goH A D15-Jul-20213.3 KiB8754

doc.goH A D15-Jul-20211.2 KiB241

duration.goH A D15-Jul-20212.5 KiB8340

duration_ext.goH A D15-Jul-20211.8 KiB4111

duration_test.goH A D15-Jul-20212.9 KiB7341

error.goH A D15-Jul-20211.7 KiB5219

error_ext.goH A D15-Jul-20211.6 KiB4011

error_test.goH A D15-Jul-20211.9 KiB5627

example_test.goH A D15-Jul-20211.4 KiB4412

float64.goH A D15-Jul-20212.3 KiB7837

float64_ext.goH A D15-Jul-20212.4 KiB7023

float64_test.goH A D15-Jul-20212.9 KiB7341

gen.goH A D15-Jul-20211.5 KiB281

go.modH A D15-Jul-2021131 96

go.sumH A D15-Jul-2021697 98

int32.goH A D15-Jul-20212.9 KiB10352

int32_test.goH A D15-Jul-20213.1 KiB8350

int64.goH A D15-Jul-20212.9 KiB10352

int64_test.goH A D15-Jul-20213.1 KiB8350

nocmp.goH A D15-Jul-20211.4 KiB362

nocmp_test.goH A D15-Jul-20214.3 KiB168110

stress_test.goH A D15-Jul-20215.8 KiB290245

string.goH A D15-Jul-20211.7 KiB5522

string_ext.goH A D15-Jul-20211.9 KiB4611

string_test.goH A D15-Jul-20213.1 KiB8652

time.goH A D15-Jul-20211.7 KiB5622

time_ext.goH A D15-Jul-20211.4 KiB3711

time_test.goH A D15-Jul-20212.8 KiB8747

uint32.goH A D15-Jul-20213 KiB10352

uint32_test.goH A D15-Jul-20213 KiB7743

uint64.goH A D15-Jul-20213 KiB10352

uint64_test.goH A D15-Jul-20213 KiB7743

uintptr.goH A D15-Jul-20213 KiB10352

uintptr_test.goH A D15-Jul-20213.2 KiB8045

unsafe_pointer.goH A D15-Jul-20212 KiB5924

unsafe_pointer_test.goH A D15-Jul-20212.6 KiB8455

value.goH A D15-Jul-20211.3 KiB326

value_test.goH A D15-Jul-20211.4 KiB4114

README.md

1# atomic [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Go Report Card][reportcard-img]][reportcard]
2
3Simple wrappers for primitive types to enforce atomic access.
4
5## Installation
6
7```shell
8$ go get -u go.uber.org/atomic@v1
9```
10
11### Legacy Import Path
12
13As of v1.5.0, the import path `go.uber.org/atomic` is the only supported way
14of using this package. If you are using Go modules, this package will fail to
15compile with the legacy import path path `github.com/uber-go/atomic`.
16
17We recommend migrating your code to the new import path but if you're unable
18to do so, or if your dependencies are still using the old import path, you
19will have to add a `replace` directive to your `go.mod` file downgrading the
20legacy import path to an older version.
21
22```
23replace github.com/uber-go/atomic => github.com/uber-go/atomic v1.4.0
24```
25
26You can do so automatically by running the following command.
27
28```shell
29$ go mod edit -replace github.com/uber-go/atomic=github.com/uber-go/atomic@v1.4.0
30```
31
32## Usage
33
34The standard library's `sync/atomic` is powerful, but it's easy to forget which
35variables must be accessed atomically. `go.uber.org/atomic` preserves all the
36functionality of the standard library, but wraps the primitive types to
37provide a safer, more convenient API.
38
39```go
40var atom atomic.Uint32
41atom.Store(42)
42atom.Sub(2)
43atom.CAS(40, 11)
44```
45
46See the [documentation][doc] for a complete API specification.
47
48## Development Status
49
50Stable.
51
52---
53
54Released under the [MIT License](LICENSE.txt).
55
56[doc-img]: https://godoc.org/github.com/uber-go/atomic?status.svg
57[doc]: https://godoc.org/go.uber.org/atomic
58[ci-img]: https://github.com/uber-go/atomic/actions/workflows/go.yml/badge.svg
59[ci]: https://github.com/uber-go/atomic/actions/workflows/go.yml
60[cov-img]: https://codecov.io/gh/uber-go/atomic/branch/master/graph/badge.svg
61[cov]: https://codecov.io/gh/uber-go/atomic
62[reportcard-img]: https://goreportcard.com/badge/go.uber.org/atomic
63[reportcard]: https://goreportcard.com/report/go.uber.org/atomic
64