You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 months ago | |
|---|---|---|
| .. | ||
| internal | 4 months ago | |
| tools | 4 months ago | |
| .codecov.yml | 3 months ago | |
| CHANGELOG.md | 3 months ago | |
| LICENSE | 4 months ago | |
| Makefile | 4 months ago | |
| README.md | 3 months ago | |
| assert_test.go | 4 months ago | |
| bool.go | 4 months ago | |
| bool_ext.go | 4 months ago | |
| bool_test.go | 4 months ago | |
| bytes.go | 4 months ago | |
| bytes_ext.go | 4 months ago | |
| bytes_test.go | 4 months ago | |
| doc.go | 4 months ago | |
| duration.go | 4 months ago | |
| duration_ext.go | 4 months ago | |
| duration_test.go | 4 months ago | |
| error.go | 4 months ago | |
| error_ext.go | 4 months ago | |
| error_test.go | 4 months ago | |
| example_test.go | 4 months ago | |
| float32.go | 4 months ago | |
| float32_ext.go | 4 months ago | |
| float32_test.go | 4 months ago | |
| float64.go | 4 months ago | |
| float64_ext.go | 4 months ago | |
| float64_test.go | 4 months ago | |
| gen.go | 4 months ago | |
| int32.go | 4 months ago | |
| int32_test.go | 4 months ago | |
| int64.go | 4 months ago | |
| int64_test.go | 4 months ago | |
| nocmp.go | 4 months ago | |
| nocmp_test.go | 4 months ago | |
| pointer_test.go | 4 months ago | |
| stress_test.go | 4 months ago | |
| string.go | 4 months ago | |
| string_ext.go | 4 months ago | |
| string_test.go | 4 months ago | |
| time.go | 4 months ago | |
| time_ext.go | 4 months ago | |
| time_test.go | 4 months ago | |
| uint32.go | 4 months ago | |
| uint32_test.go | 4 months ago | |
| uint64.go | 4 months ago | |
| uint64_test.go | 4 months ago | |
| uintptr.go | 4 months ago | |
| uintptr_test.go | 4 months ago | |
| unsafe_pointer.go | 4 months ago | |
| unsafe_pointer_test.go | 4 months ago | |
| value.go | 4 months ago | |
| value_test.go | 4 months ago | |
README.md
atomic
Simple wrappers for primitive types to enforce atomic access.
Installation
$ go get -u github.com/mleku/nodl/pkg/atomic@latest
Usage
The standard library's sync/atomic is powerful, but it's easy to forget which
variables must be accessed atomically. github.com/mleku/nodl/pkg/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.CompareAndSwap(40, 11)
See the [documentation][doc] for a complete API specification.
Development Status
Stable.
Released under the MIT License.