diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 814a68e2ec6..76356c11bc3 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -56,6 +56,7 @@ struct Sched { Lock; G *gfree; // available gs (status == Gdead) + int32 goidgen; G *ghead; // gs waiting to run G *gtail; @@ -907,8 +908,8 @@ runtime·newproc1(byte *fn, byte *argp, int32 narg, int32 nret, void *callerpc) newg->gopc = (uintptr)callerpc; runtime·sched.gcount++; - runtime·goidgen++; - newg->goid = runtime·goidgen; + runtime·sched.goidgen++; + newg->goid = runtime·sched.goidgen; newprocreadylocked(newg); schedunlock(); diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index 48cd482dd90..83ea0f9ce2e 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -369,7 +369,6 @@ extern Alg runtime·algarray[Amax]; extern String runtime·emptystring; G* runtime·allg; M* runtime·allm; -int32 runtime·goidgen; extern int32 runtime·gomaxprocs; extern uint32 runtime·panicking; extern int32 runtime·gcwaiting; // gc is waiting to run