aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-02-15 17:54:46 -0500
committerRuss Cox <rsc@golang.org>2013-02-15 17:54:46 -0500
commit60526ca6d105ee5cf79ede6b964de30ceea79fd3 (patch)
treeb4f56cf8d9a59159b235cf160fab6d524d39b58b /src/pkg/runtime/proc.c
parentc92d3552e5de31a5195aef5ff04979d61dcbf1a6 (diff)
downloadgo-60526ca6d105ee5cf79ede6b964de30ceea79fd3.tar.xz
undo CL 7310096 / 59da6744d66d
broke windows build ««« original CL description runtime: ensure forward progress of runtime.Gosched() for locked goroutines The removed code leads to the situation when M executes the same locked G again and again. Fixes #4820. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7310096 »»» TBR=dvyukov CC=golang-dev https://golang.org/cl/7343050
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 5c60cddf9b..f8ddf9b47e 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -397,6 +397,14 @@ canaddmcpu(void)
static void
gput(G *gp)
{
+ M *mp;
+
+ // If g is wired, hand it off directly.
+ if((mp = gp->lockedm) != nil && canaddmcpu()) {
+ mnextg(mp, gp);
+ return;
+ }
+
// If g is the idle goroutine for an m, hand it off.
if(gp->idlem != nil) {
if(gp->idlem->idleg != nil) {