From d39f5aa373a4422f7a5f3ee764fb0f6b0b719d61 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Thu, 30 Jun 2011 15:34:22 +0200 Subject: Imported Upstream version 58 --- src/pkg/runtime/linux/thread.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pkg/runtime/linux/thread.c') diff --git a/src/pkg/runtime/linux/thread.c b/src/pkg/runtime/linux/thread.c index 7166b0ef2..7c7ca7b4e 100644 --- a/src/pkg/runtime/linux/thread.c +++ b/src/pkg/runtime/linux/thread.c @@ -116,7 +116,7 @@ again: // // We only really care that (v&1) == 1 (the lock is held), // and in fact there is a futex variant that could - // accomodate that check, but let's not get carried away.) + // accommodate that check, but let's not get carried away.) futexsleep(&l->key, v+2); // We're awake: remove ourselves from the count. @@ -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 -- cgit v1.2.3