Skip to content

Commit c3d1d42

Browse files
callthingsoffgopherbot
authored andcommitted
sync/atomic: amend comments for Value.{Swap,CompareAndSwap}
Related to CL 241661, CL 403094. Change-Id: I86877d9a013b05b1a97f9aa1333cd96ce98469cb GitHub-Last-Rev: 7fedca5 GitHub-Pull-Request: #76259 Reviewed-on: https://go-review.googlesource.com/c/go/+/719660 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Junyang Shao <[email protected]>
1 parent e0807ba commit c3d1d42

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sync/atomic/value.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ func (v *Value) Swap(new any) (old any) {
9898
if typ == nil {
9999
// Attempt to start first store.
100100
// Disable preemption so that other goroutines can use
101-
// active spin wait to wait for completion; and so that
102-
// GC does not see the fake type accidentally.
101+
// active spin wait to wait for completion.
103102
runtime_procPin()
104103
if !CompareAndSwapPointer(&vp.typ, nil, unsafe.Pointer(&firstStoreInProgress)) {
105104
runtime_procUnpin()
@@ -150,8 +149,7 @@ func (v *Value) CompareAndSwap(old, new any) (swapped bool) {
150149
}
151150
// Attempt to start first store.
152151
// Disable preemption so that other goroutines can use
153-
// active spin wait to wait for completion; and so that
154-
// GC does not see the fake type accidentally.
152+
// active spin wait to wait for completion.
155153
runtime_procPin()
156154
if !CompareAndSwapPointer(&vp.typ, nil, unsafe.Pointer(&firstStoreInProgress)) {
157155
runtime_procUnpin()

0 commit comments

Comments
 (0)