mirror of
https://github.com/golang/go
synced 2024-11-21 21:34:40 -07:00
runtime: in exitsyscall, avoid confusing garbage collector
R=r CC=golang-dev https://golang.org/cl/178046
This commit is contained in:
parent
31de4d4c5d
commit
19c18358ca
@ -566,14 +566,19 @@ runtime·exitsyscall(void)
|
||||
unlock(&sched);
|
||||
return;
|
||||
}
|
||||
g->status = Grunning;
|
||||
sched.msyscall--;
|
||||
sched.mcpu++;
|
||||
// Fast path - if there's room for this m, we're done.
|
||||
if(sched.mcpu <= sched.mcpumax) {
|
||||
g->status = Grunning;
|
||||
unlock(&sched);
|
||||
return;
|
||||
}
|
||||
// Tell scheduler to put g back on the run queue:
|
||||
// mostly equivalent to g->status = Grunning,
|
||||
// but keeps the garbage collector from thinking
|
||||
// that g is running right now, which it's not.
|
||||
g->readyonstop = 1;
|
||||
unlock(&sched);
|
||||
|
||||
// Slow path - all the cpus are taken.
|
||||
|
Loading…
Reference in New Issue
Block a user