From: Ulrich Drepper Date: Fri, 16 May 2003 22:09:32 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc-2_3_3~720 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ac5b8e2fae145766821d141cf892bbfa50d6618;p=platform%2Fupstream%2Fglibc.git Update. * pthread_join.c (pthread_join): Set tid field of the joined thread to -1. This isn't necessary but helps to recognize some error conditions with almost no cost. * allocatestack.c (FREE_P): Also negative values indicate an unused stack. --- diff --git a/nptl/ChangeLog b/nptl/ChangeLog index e63c71c841..60b03f764d 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,5 +1,12 @@ 2003-05-16 Ulrich Drepper + * pthread_join.c (pthread_join): Set tid field of the joined + thread to -1. This isn't necessary but helps to recognize some + error conditions with almost no cost. + + * allocatestack.c (FREE_P): Also negative values indicate an + unused stack. + * unwind.c: Include . 2003-05-14 Ulrich Drepper diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 95ee992a18..9653b62cab 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -111,7 +111,7 @@ static unsigned int nptl_ncreated; /* Check whether the stack is still used or not. */ -#define FREE_P(descr) ((descr)->tid == 0) +#define FREE_P(descr) ((descr)->tid <= 0) /* We create a double linked list of all cache entries. Double linked diff --git a/nptl/pthread_join.c b/nptl/pthread_join.c index f77c2c9f98..f94128dd96 100644 --- a/nptl/pthread_join.c +++ b/nptl/pthread_join.c @@ -93,6 +93,9 @@ pthread_join (threadid, thread_return) pthread_cleanup_pop (0); + /* We mark the thread as terminated and as joined. */ + pd->tid = -1; + /* Store the return value if the caller is interested. */ if (thread_return != NULL) *thread_return = pd->result;