diff options
Diffstat (limited to 'typedsync/value.go')
-rw-r--r-- | typedsync/value.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/typedsync/value.go b/typedsync/value.go index 99c8876..90c8b55 100644 --- a/typedsync/value.go +++ b/typedsync/value.go @@ -8,11 +8,15 @@ import ( "sync" ) -// Value is a typed equivalent of sync/atomic.Value. +// Value is a type-safe equivalent of the standard library's +// sync/atomic.Value. // -// It is not actually a wrapper around sync/atomic.Value for -// allocation-performance reasons. +// See the [sync/atomic.Value documentation] for full details. +// +// [sync/atomic.Value documentation]: https://pkg.go.dev/sync/atomic#Value type Value[T comparable] struct { + // It is not actually a wrapper around sync/atomic.Value for + // allocation-performance reasons. mu sync.Mutex ok bool val T |