func goready(gp *g, traceskip int) {
systemstack(func() {
- ready(gp, traceskip)
+ ready(gp, traceskip, true)
})
}
}
// Mark gp ready to run.
-func ready(gp *g, traceskip int) {
+func ready(gp *g, traceskip int, next bool) {
if trace.enabled {
traceGoUnpark(gp, traceskip)
}
// status is Gwaiting or Gscanwaiting, make Grunnable and put on runq
casgstatus(gp, _Gwaiting, _Grunnable)
- runqput(_g_.m.p.ptr(), gp, true)
+ runqput(_g_.m.p.ptr(), gp, next)
if atomic.Load(&sched.npidle) != 0 && atomic.Load(&sched.nmspinning) == 0 { // TODO: fast atomic
wakep()
}
}
if fingwait && fingwake {
if gp := wakefing(); gp != nil {
- ready(gp, 0)
+ ready(gp, 0, true)
}
}