add atomic duration type (#37)

wrapper around existing `Int64` type for atomic operations on `time.Duration` values
3 files changed
tree: bcb68c16491d1a51b71826ee38f4aef07fe32e9f
  1. .codecov.yml
  2. .github/
  3. .gitignore
  4. .travis.yml
  5. LICENSE.txt
  6. Makefile
  8. atomic.go
  9. atomic_test.go
  10. example_test.go
  11. glide.lock
  12. glide.yaml
  13. scripts/
  14. stress_test.go
  15. string.go
  16. string_test.go

atomic GoDoc Build Status Coverage Status Go Report Card

Simple wrappers for primitive types to enforce atomic access.


go get -u


The standard library‘s sync/atomic is powerful, but it’s easy to forget which variables must be accessed atomically. 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.CAS(40, 11)

See the documentation for a complete API specification.

Development Status