1
0
mirror of https://github.com/golang/go synced 2024-11-21 20:34:40 -07:00

runtime: handle out-of-threads on Linux gracefully

R=rsc
CC=golang-dev
https://golang.org/cl/4396050
This commit is contained in:
Albert Strasheim 2011-05-06 15:29:49 -04:00 committed by Russ Cox
parent 606e12f9bf
commit 0629354bd3

View File

@ -252,10 +252,10 @@ runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void))
stk, m, g, fn, runtime·clone, m->id, m->tls[0], &m);
}
ret = runtime·clone(flags, stk, m, g, fn);
if(ret < 0)
*(int32*)123 = 123;
if((ret = runtime·clone(flags, stk, m, g, fn)) < 0) {
runtime·printf("runtime: failed to create new OS thread (have %d already; errno=%d)\n", runtime·mcount(), -ret);
runtime·throw("runtime.newosproc");
}
}
void