aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-10 07:45:56 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-10 07:45:56 +0000
commitee5d48553adde607b88bcbb1ac533d88f6a0207a (patch)
treee0a9ad909098c846e12a634b8d3b4111b24d9b6f /linuxthreads/pthread.c
parent7e6d3809908ca640e5334ced033d6f905783731a (diff)
downloadglibc-ee5d48553adde607b88bcbb1ac533d88f6a0207a.tar
glibc-ee5d48553adde607b88bcbb1ac533d88f6a0207a.tar.gz
glibc-ee5d48553adde607b88bcbb1ac533d88f6a0207a.tar.bz2
glibc-ee5d48553adde607b88bcbb1ac533d88f6a0207a.zip
Update.
2000-06-10 Ulrich Drepper <drepper@redhat.com> * pthread.c (__pthread_create_2_1): Optimize a bit. * internals.h (invalid_handle): Also test for p_terminated != 0. (nonexisting_handle): New function. Same as old invalid_handle. * join.c (pthread_join): Use nonexisting_handle instead of invalid_handle to test for acceptable thread handle. Reported by Permaine Cheung <pcheung@cygnus.com>.
Diffstat (limited to 'linuxthreads/pthread.c')
-rw-r--r--linuxthreads/pthread.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 0f63127475..38bf197a62 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -500,6 +500,7 @@ int __pthread_create_2_1(pthread_t *thread, const pthread_attr_t *attr,
{
pthread_descr self = thread_self();
struct pthread_request request;
+ int retval;
if (__pthread_manager_request < 0) {
if (__pthread_initialize_manager() < 0) return EAGAIN;
}
@@ -512,9 +513,10 @@ int __pthread_create_2_1(pthread_t *thread, const pthread_attr_t *attr,
&request.req_args.create.mask);
__libc_write(__pthread_manager_request, (char *) &request, sizeof(request));
suspend(self);
- if (THREAD_GETMEM(self, p_retcode) == 0)
+ retval = THREAD_GETMEM(self, p_retcode;
+ if (retval == 0)
*thread = (pthread_t) THREAD_GETMEM(self, p_retval);
- return THREAD_GETMEM(self, p_retcode);
+ return retval;
}
versioned_symbol (libpthread, __pthread_create_2_1, pthread_create, GLIBC_2_1);