From 472022708ee08ac559dde540891eb2f8c2a9afcf Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 14 Feb 2003 23:31:11 +0000 Subject: Update. 2003-02-14 Ulrich Drepper * sysdeps/generic/libc-start.c [HAVE_PTR_NTHREADS]: Decrement thread counter and only call __exit_thread if this is not the last thread. --- nptl/allocatestack.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'nptl/allocatestack.c') 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; -- cgit v1.2.1