var (
iocphandle uintptr = _INVALID_HANDLE_VALUE // completion port io handle
- netpollWakeSig uint32 // used to avoid duplicate calls of netpollBreak
+ netpollWakeSig atomic.Uint32 // used to avoid duplicate calls of netpollBreak
)
func netpollinit() {
func netpollBreak() {
// Failing to cas indicates there is an in-flight wakeup, so we're done here.
- if !atomic.Cas(&netpollWakeSig, 0, 1) {
+ if !netpollWakeSig.CompareAndSwap(0, 1) {
return
}
}
handlecompletion(&toRun, op, errno, qty)
} else {
- atomic.Store(&netpollWakeSig, 0)
+ netpollWakeSig.Store(0)
if delay == 0 {
// Forward the notification to the
// blocked poller.