runtime: convert common scheduler functions to Go

These are required for chans, semaphores, timers, etc.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, rlh, rsc
https://golang.org/cl/123640043
This commit is contained in:
Dmitriy Vyukov 2014-08-21 20:41:09 +04:00
parent 6b112c24db
commit 684de04118
20 changed files with 175 additions and 50 deletions

View file

@ -343,7 +343,7 @@ runtime·oldstack(void)
gp->sched.ret = g->m->cret;
g->m->cret = 0; // drop reference
gp->status = Gwaiting;
gp->waitreason = "stack unsplit";
gp->waitreason = runtime·gostringnocopy((byte*)"stack unsplit");
if(argsize > 0) {
sp -= argsize;
@ -860,7 +860,7 @@ runtime·newstack(void)
g->m->morebuf.lr = (uintptr)nil;
g->m->morebuf.sp = (uintptr)nil;
gp->status = Gwaiting;
gp->waitreason = "stack growth";
gp->waitreason = runtime·gostringnocopy((byte*)"stack growth");
newstackcall = framesize==1;
if(newstackcall)
framesize = 0;