}
// checkTimeouts resumes goroutines that are waiting on a note which has reached its deadline.
+// TODO(drchase): need to understand if write barriers are really okay in this context.
+//
+//go:yeswritebarrierrec
func checkTimeouts() {
now := nanotime()
+ // TODO: map iteration has the write barriers in it; is that okay?
for n, nt := range notesWithTimeout {
if n.key == note_cleared && now >= nt.deadline {
n.key = note_timeout
// If an event handler returned, we resume it and it will pause the execution.
// beforeIdle either returns the specific goroutine to schedule next or
// indicates with otherReady that some goroutine became ready.
+// TODO(drchase): need to understand if write barriers are really okay in this context.
+//
+//go:yeswritebarrierrec
func beforeIdle(now, pollUntil int64) (gp *g, otherReady bool) {
delay := int64(-1)
if pollUntil != 0 {
}
if len(events) == 0 {
+ // TODO: this is the line that requires the yeswritebarrierrec
go handleAsyncEvent()
return nil, true
}
} else {
// build error string
var tmp [32]byte
- status = append(itoa(tmp[:len(tmp)-1], uint64(e)), 0)
+ sl := itoa(tmp[:len(tmp)-1], uint64(e))
+ // Don't append, rely on the existing data being zero.
+ status = tmp[:len(sl)+1]
}
goexitsall(&status[0])
exits(&status[0])