libc_port_dissociate,
libc_port_getn,
libc_port_alert libcFunc
- netpollWakeSig uint32 // used to avoid duplicate calls of netpollBreak
+ netpollWakeSig atomic.Uint32 // used to avoid duplicate calls of netpollBreak
)
func errno() int32 {
// netpollBreak interrupts a port_getn wait.
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
}
println("runtime: port_alert failed with", e)
throw("runtime: netpoll: port_alert failed")
}
- atomic.Store(&netpollWakeSig, 0)
+ netpollWakeSig.Store(0)
}
continue
}