aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/linux
diff options
context:
space:
mode:
authorAlbert Strasheim <fullung@gmail.com>2011-05-06 15:29:49 -0400
committerRuss Cox <rsc@golang.org>2011-05-06 15:29:49 -0400
commit0629354bd3a2eb8d9f2e1bafdd508120f94422ef (patch)
tree8c18dd3c5f6a3967a9c596859db67ff0efe9ae56 /src/pkg/runtime/linux
parent606e12f9bfb1b2a6d6f5e7da73bc69c9569329e2 (diff)
downloadgo-0629354bd3a2eb8d9f2e1bafdd508120f94422ef.tar.xz
runtime: handle out-of-threads on Linux gracefully
R=rsc CC=golang-dev https://golang.org/cl/4396050
Diffstat (limited to 'src/pkg/runtime/linux')
-rw-r--r--src/pkg/runtime/linux/thread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/runtime/linux/thread.c b/src/pkg/runtime/linux/thread.c
index 7166b0ef27..6c506236fb 100644
--- a/src/pkg/runtime/linux/thread.c
+++ b/src/pkg/runtime/linux/thread.c
@@ -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