about summary refs log tree commit diff
path: root/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-27 09:29:04 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-27 09:29:04 +0000
commitb863ccd7c053a4d4b79b37a91679a01fa098b849 (patch)
tree684255c8513e34bb62717e638a55a4b0c7390a96 /linuxthreads/pthread.c
parent3b0bdc723579a7c6df2cace0115a6ca0977d73f9 (diff)
downloadglibc-b863ccd7c053a4d4b79b37a91679a01fa098b849.tar.gz
glibc-b863ccd7c053a4d4b79b37a91679a01fa098b849.tar.xz
glibc-b863ccd7c053a4d4b79b37a91679a01fa098b849.zip
Update.
2002-02-27  Ulrich Drepper  <drepper@redhat.com>

	* pthread.c [USE_TLS] (thread_self_stack): Correct check for upper
	stack limit.
Diffstat (limited to 'linuxthreads/pthread.c')
-rw-r--r--linuxthreads/pthread.c6
1 files changed, 6 insertions, 0 deletions
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;
 }