Commit 0629354b authored by Albert Strasheim's avatar Albert Strasheim Committed by Russ Cox

runtime: handle out-of-threads on Linux gracefully

R=rsc
CC=golang-dev
https://golang.org/cl/4396050
parent 606e12f9
...@@ -252,10 +252,10 @@ runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void)) ...@@ -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); stk, m, g, fn, runtime·clone, m->id, m->tls[0], &m);
} }
ret = runtime·clone(flags, stk, m, g, fn); 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);
if(ret < 0) runtime·throw("runtime.newosproc");
*(int32*)123 = 123; }
} }
void void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment