about summary refs log tree commit diff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-14 23:31:11 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-14 23:31:11 +0000
commit472022708ee08ac559dde540891eb2f8c2a9afcf (patch)
treef30a25b8039eab48c7b6e2737a5f856bdb853b78 /nptl/allocatestack.c
parente320ef46a7283517aeba1decc20ffb38ed131281 (diff)
downloadglibc-472022708ee08ac559dde540891eb2f8c2a9afcf.tar.gz
glibc-472022708ee08ac559dde540891eb2f8c2a9afcf.tar.xz
glibc-472022708ee08ac559dde540891eb2f8c2a9afcf.zip
Update.
2003-02-14  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/generic/libc-start.c [HAVE_PTR_NTHREADS]: Decrement thread
	counter and only call __exit_thread if this is not the last thread.
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 1a4bf44367..9d7f7618ec 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -74,9 +74,6 @@ static LIST_HEAD (stack_used);
 list_t __stack_user __attribute__ ((nocommon));
 hidden_def (__stack_user)
 
-/* Number of threads running.  */
-static unsigned int nptl_nthreads = 1;
-
 /* Number of threads created.  */
 static unsigned int nptl_ncreated;
 
@@ -142,9 +139,6 @@ get_cached_stack (size_t *sizep, void **memp)
   /* And add to the list of stacks in use.  */
   list_add (&result->header.data.list, &stack_used);
 
-  /* One more thread.  */
-  ++nptl_nthreads;
-
   /* And decrease the cache size.  */
   stack_cache_actsize -= result->stackblock_size;
 
@@ -299,9 +293,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
       /* And add to the list of stacks in use.  */
       list_add (&pd->header.data.list, &__stack_user);
 
-      /* One more thread.  */
-      ++nptl_nthreads;
-
       lll_unlock (stack_cache_lock);
     }
   else
@@ -416,9 +407,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	  /* And add to the list of stacks in use.  */
 	  list_add (&pd->header.data.list, &stack_used);
 
-	  /* One more thread.  */
-	  ++nptl_nthreads;
-
 	  lll_unlock (stack_cache_lock);
 
 
@@ -444,9 +432,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	      /* Remove the thread from the list.  */
 	      list_del (&pd->header.data.list);
 
-	      /* The thread is gone.  */
-	      --nptl_nthreads;
-
 	      lll_unlock (stack_cache_lock);
 
 	      /* Free the memory regardless of whether the size of the
@@ -510,9 +495,6 @@ __deallocate_stack (struct pthread *pd)
     /* Free the memory associated with the ELF TLS.  */
     _dl_deallocate_tls (pd, false);
 
-  /* One less thread.  */
-  --nptl_nthreads;
-
   lll_unlock (stack_cache_lock);
 }
 
@@ -563,7 +545,7 @@ __reclaim_stacks (void)
     list_add (&self->header.data.list, &stack_used);
 
   /* There is one thread running.  */
-  nptl_nthreads = 1;
+  __nptl_nthreads = 1;
 
   /* Initialize the lock.  */
   stack_cache_lock = LLL_LOCK_INITIALIZER;