From b863ccd7c053a4d4b79b37a91679a01fa098b849 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 27 Feb 2002 09:29:04 +0000 Subject: [PATCH] Update. 2002-02-27 Ulrich Drepper * pthread.c [USE_TLS] (thread_self_stack): Correct check for upper stack limit. --- linuxthreads/ChangeLog | 5 +++++ linuxthreads/pthread.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 961ddf118b..01e4745e03 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,8 @@ +2002-02-27 Ulrich Drepper + + * pthread.c [USE_TLS] (thread_self_stack): Correct check for upper + stack limit. + 2002-02-23 Ulrich Drepper * attr.c (pthread_getattr_np): Don't take thread descriptor size diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index 314360d477..12ce38ba75 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -813,8 +813,14 @@ static pthread_descr thread_self_stack(void) if (sp >= __pthread_manager_thread_bos && sp < __pthread_manager_thread_tos) return manager_thread; h = __pthread_handles + 2; +# ifdef USE_TLS + while (h->h_descr == NULL + || ! (sp <= (char *) h->h_descr->p_stackaddr && sp >= h->h_bottom)) + h++; +# else while (! (sp <= (char *) h->h_descr && sp >= h->h_bottom)) h++; +# endif return h->h_descr; }