From ee5d48553adde607b88bcbb1ac533d88f6a0207a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 10 Jun 2000 07:45:56 +0000 Subject: Update. 2000-06-10 Ulrich Drepper * 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 . --- linuxthreads/internals.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linuxthreads/internals.h') diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h index c523d6f23b..405af3c0df 100644 --- a/linuxthreads/internals.h +++ b/linuxthreads/internals.h @@ -297,6 +297,11 @@ static inline pthread_handle thread_handle(pthread_t id) /* Validate a thread handle. Must have acquired h->h_spinlock before. */ static inline int invalid_handle(pthread_handle h, pthread_t id) +{ + return h->h_descr == NULL || h->h_descr->p_tid != id || h->h_descr->p_terminated; +} + +static inline int nonexisting_handle(pthread_handle h, pthread_t id) { return h->h_descr == NULL || h->h_descr->p_tid != id; } -- cgit v1.2.3