summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/pthread/createthread.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
committerJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
commit574e283890a6ca92325a06dafa76ff307a8019a2 (patch)
tree055e44e24a55fb4863e5d9cdc04e320cde52ffe9 /nptl/sysdeps/pthread/createthread.c
parenta162e5955f7e324be82d9318bbcbe869c66ffb86 (diff)
downloadglibc-574e283890a6ca92325a06dafa76ff307a8019a2.tar
glibc-574e283890a6ca92325a06dafa76ff307a8019a2.tar.gz
glibc-574e283890a6ca92325a06dafa76ff307a8019a2.tar.bz2
glibc-574e283890a6ca92325a06dafa76ff307a8019a2.zip
Updated to fedora-glibc-20071212T1051
Diffstat (limited to 'nptl/sysdeps/pthread/createthread.c')
-rw-r--r--nptl/sysdeps/pthread/createthread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nptl/sysdeps/pthread/createthread.c b/nptl/sysdeps/pthread/createthread.c
index 66571b2175..59e62c2dcf 100644
--- a/nptl/sysdeps/pthread/createthread.c
+++ b/nptl/sysdeps/pthread/createthread.c
@@ -56,8 +56,8 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
PREPARE_CREATE;
#endif
- if (stopped)
- /* We Make sure the thread does not run far by forcing it to get a
+ if (__builtin_expect (stopped != 0, 0))
+ /* We make sure the thread does not run far by forcing it to get a
lock. We lock it here too so that the new thread cannot continue
until we tell it to. */
lll_lock (pd->lock, LLL_PRIVATE);
@@ -84,7 +84,8 @@ do_clone (struct pthread *pd, const struct pthread_attr *attr,
if (IS_DETACHED (pd))
__deallocate_stack (pd);
- return errno;
+ /* We have to translate error codes. */
+ return errno == ENOMEM ? EAGAIN : errno;
}
/* Now we have the possibility to set scheduling parameters etc. */