Clarify reading op non-atomically
This commit is contained in:
@@ -42,5 +42,11 @@ func main() {
|
||||
|
||||
// Wait until all the goroutines are done.
|
||||
wg.Wait()
|
||||
|
||||
// It's safe to access `ops` now because we know
|
||||
// no other goroutine is writing to it. Reading
|
||||
// atomics safely while they are being updated is
|
||||
// also possible, using functions like
|
||||
// `atomic.LoadUint64`.
|
||||
fmt.Println("ops:", ops)
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
103c9b7d036e3a5c14dc481755b78b10dc9f894e
|
||||
GRkVf6J1--B
|
||||
8ebec0be3b167021c96b8b497d0e8c0a2ea99385
|
||||
F2pJfduyQiA
|
||||
|
||||
Reference in New Issue
Block a user