Lines Matching full:gp
76 // suspendG suspends goroutine gp at a safe-point and returns the
105 func suspendG(gp *g) suspendGState {
123 switch s := readgstatus(gp); s {
134 dumpgstatus(gp)
153 if !casGFromPreempted(gp, _Gpreempted, _Gwaiting) {
165 // This may race with execution or readying of gp.
167 if !castogscanstatus(gp, s, s|_Gscan) {
174 gp.preemptStop = false
175 gp.preempt = false
176 gp.stackguard0 = gp.stack.lo + stackGuard
190 return suspendGState{g: gp, stopped: stopped}
195 …if gp.preemptStop && gp.preempt && gp.stackguard0 == stackPreempt && asyncM == gp.m && asyncM.pree…
200 if !castogscanstatus(gp, _Grunning, _Gscanrunning) {
205 gp.preemptStop = true
206 gp.preempt = true
207 gp.stackguard0 = stackPreempt
210 asyncM2 := gp.m
216 casfrom_Gscanstatus(gp, _Gscanrunning, _Grunning)
264 gp := state.g
265 switch s := readgstatus(gp); s {
267 dumpgstatus(gp)
273 casfrom_Gscanstatus(gp, s, s&^_Gscan)
278 ready(gp, 0, true)
303 gp := getg()
304 gp.asyncSafePoint = true
305 if gp.preemptStop {
310 gp.asyncSafePoint = false
341 // queued for gp.
342 func wantAsyncPreempt(gp *g) bool {
344 return (gp.preempt || gp.m.p != 0 && gp.m.p.ptr().preempt) && readgstatus(gp)&^_Gscan == _Grunning
347 // isAsyncSafePoint reports whether gp at instruction PC is an
350 // 1. It's safe to suspend gp and conservatively scan its stack and
354 // 2. gp has enough stack space to inject the asyncPreempt call.
363 func isAsyncSafePoint(gp *g, pc, sp, lr uintptr) (bool, uintptr) {
364 mp := gp.m
369 if mp.curg != gp {
379 if sp < gp.stack.lo || sp-gp.stack.lo < asyncPreemptStack {