replace deprecated function CAS in examples (#138)
Update example_test.go and README.md replacing deprecated func
This commit is contained in:
@@ -40,7 +40,7 @@ provide a safer, more convenient API.
|
|||||||
var atom atomic.Uint32
|
var atom atomic.Uint32
|
||||||
atom.Store(42)
|
atom.Store(42)
|
||||||
atom.Sub(2)
|
atom.Sub(2)
|
||||||
atom.CAS(40, 11)
|
atom.CompareAndSwap(40, 11)
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation][doc] for a complete API specification.
|
See the [documentation][doc] for a complete API specification.
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func Example() {
|
|||||||
// The wrapper ensures that all operations are atomic.
|
// The wrapper ensures that all operations are atomic.
|
||||||
atom.Store(42)
|
atom.Store(42)
|
||||||
fmt.Println(atom.Inc())
|
fmt.Println(atom.Inc())
|
||||||
fmt.Println(atom.CAS(43, 0))
|
fmt.Println(atom.CompareAndSwap(43, 0))
|
||||||
fmt.Println(atom.Load())
|
fmt.Println(atom.Load())
|
||||||
|
|
||||||
// Output:
|
// Output:
|
||||||
|
|||||||
Reference in New Issue
Block a user