1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:14:46 -07:00

runtime: allow stack split in body of closechan

This gives more space during the call to runtime.lock.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11679043
This commit is contained in:
Dmitriy Vyukov 2013-07-22 20:47:39 +04:00
parent 27134567fa
commit 10d1e55103

View File

@ -1214,10 +1214,27 @@ reflect·rselect(Slice cases, intgo chosen, uintptr word, bool recvOK)
FLUSH(&recvOK); FLUSH(&recvOK);
} }
static void closechan(Hchan *c, void *pc);
// closechan(sel *byte); // closechan(sel *byte);
#pragma textflag 7 #pragma textflag 7
void void
runtime·closechan(Hchan *c) runtime·closechan(Hchan *c)
{
closechan(c, runtime·getcallerpc(&c));
}
// For reflect
// func chanclose(c chan)
#pragma textflag 7
void
reflect·chanclose(Hchan *c)
{
closechan(c, runtime·getcallerpc(&c));
}
static void
closechan(Hchan *c, void *pc)
{ {
SudoG *sg; SudoG *sg;
G* gp; G* gp;
@ -1235,7 +1252,7 @@ runtime·closechan(Hchan *c)
} }
if(raceenabled) { if(raceenabled) {
runtime·racewritepc(c, runtime·getcallerpc(&c), runtime·closechan); runtime·racewritepc(c, pc, runtime·closechan);
runtime·racerelease(c); runtime·racerelease(c);
} }
@ -1264,14 +1281,6 @@ runtime·closechan(Hchan *c)
runtime·unlock(c); runtime·unlock(c);
} }
// For reflect
// func chanclose(c chan)
void
reflect·chanclose(Hchan *c)
{
runtime·closechan(c);
}
// For reflect // For reflect
// func chanlen(c chan) (len int) // func chanlen(c chan) (len int)
void void