This fixes the Plan 9 support for the new timer code.
Updates #6239
Updates #27707
Change-Id: Ia498c399b8924910b97fcde07545fae3588aad47
Reviewed-on: https://go-review.googlesource.com/c/go/+/204045
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
var netpollBroken uint32
func netpollGenericInit() {
+ atomic.Store(&netpollInited, 1)
}
func netpollBreak() {
// Implementation for platforms that do not support
// integrated network poller.
if delay != 0 {
+ // This lock ensures that only one goroutine tries to use
+ // the note. It should normally be completely uncontended.
+ lock(&netpollStubLock)
noteclear(&netpollNote)
atomic.Store(&netpollBroken, 0)
notetsleep(&netpollNote, delay)
+ unlock(&netpollStubLock)
}
return gList{}
}
func netpollinited() bool {
- return false
+ return atomic.Load(&netpollInited) != 0
}