[dev.cc] all: merge default (8d42099cdc23) into dev.cc

TBR=austin
CC=golang-codereviews
https://golang.org/cl/178700044
This commit is contained in:
Russ Cox 2014-12-05 11:18:10 -05:00
commit 829b286f2c
17 changed files with 269 additions and 58 deletions

View file

@ -563,13 +563,7 @@ func copystack(gp *g, newsize uintptr) {
}
memmove(unsafe.Pointer(new.hi-used), unsafe.Pointer(old.hi-used), used)
oldstatus := readgstatus(gp)
oldstatus &^= _Gscan
if oldstatus == _Gwaiting || oldstatus == _Grunnable {
casgstatus(gp, oldstatus, _Gcopystack) // oldstatus is Gwaiting or Grunnable
} else {
gothrow("copystack: bad status, not Gwaiting or Grunnable")
}
oldstatus := casgcopystack(gp) // cas from Gwaiting or Grunnable to Gcopystack, return old status
// Swap out old stack for new one
gp.stack = new