@@ -101,7 +101,7 @@ func (v *Value) Swap(new any) (old any) {
101
101
// active spin wait to wait for completion; and so that
102
102
// GC does not see the fake type accidentally.
103
103
runtime_procPin ()
104
- if ! CompareAndSwapPointer (& vp .typ , nil , unsafe .Pointer (^ uintptr ( 0 ) )) {
104
+ if ! CompareAndSwapPointer (& vp .typ , nil , unsafe .Pointer (& firstStoreInProgress )) {
105
105
runtime_procUnpin ()
106
106
continue
107
107
}
@@ -111,7 +111,7 @@ func (v *Value) Swap(new any) (old any) {
111
111
runtime_procUnpin ()
112
112
return nil
113
113
}
114
- if uintptr ( typ ) == ^ uintptr ( 0 ) {
114
+ if typ == unsafe . Pointer ( & firstStoreInProgress ) {
115
115
// First store in progress. Wait.
116
116
// Since we disable preemption around the first store,
117
117
// we can wait with active spinning.
@@ -153,7 +153,7 @@ func (v *Value) CompareAndSwap(old, new any) (swapped bool) {
153
153
// active spin wait to wait for completion; and so that
154
154
// GC does not see the fake type accidentally.
155
155
runtime_procPin ()
156
- if ! CompareAndSwapPointer (& vp .typ , nil , unsafe .Pointer (^ uintptr ( 0 ) )) {
156
+ if ! CompareAndSwapPointer (& vp .typ , nil , unsafe .Pointer (& firstStoreInProgress )) {
157
157
runtime_procUnpin ()
158
158
continue
159
159
}
@@ -163,7 +163,7 @@ func (v *Value) CompareAndSwap(old, new any) (swapped bool) {
163
163
runtime_procUnpin ()
164
164
return true
165
165
}
166
- if uintptr ( typ ) == ^ uintptr ( 0 ) {
166
+ if typ == unsafe . Pointer ( & firstStoreInProgress ) {
167
167
// First store in progress. Wait.
168
168
// Since we disable preemption around the first store,
169
169
// we can wait with active spinning.
0 commit comments