summaryrefslogtreecommitdiff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-02-04 22:36:03 +0000
committerJakub Jelinek <jakub@redhat.com>2009-02-04 22:36:03 +0000
commit73c5dd45bc405428148ee740cac61a1279fe57d4 (patch)
tree878555d8c116d7ac9cb716b79e10d240fde946a3 /nptl/allocatestack.c
parent23a4b43d6a98912d505458daeced44b22830a773 (diff)
downloadglibc-73c5dd45bc405428148ee740cac61a1279fe57d4.tar
glibc-73c5dd45bc405428148ee740cac61a1279fe57d4.tar.gz
glibc-73c5dd45bc405428148ee740cac61a1279fe57d4.tar.bz2
glibc-73c5dd45bc405428148ee740cac61a1279fe57d4.zip
Updated to fedora-glibc-20090204T2135cvs/fedora-glibc-2_9_90-3
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index ce05770e56..67ea0c68f8 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -248,8 +248,8 @@ get_cached_stack (size_t *sizep, void **memp)
/* Free stacks until cache size is lower than LIMIT. */
-static void
-free_stacks (size_t limit)
+void
+__free_stacks (size_t limit)
{
/* We reduce the size of the cache. Remove the last entries until
the size is below the limit. */
@@ -299,15 +299,7 @@ queue_stack (struct pthread *stack)
stack_cache_actsize += stack->stackblock_size;
if (__builtin_expect (stack_cache_actsize > stack_cache_maxsize, 0))
- free_stacks (stack_cache_maxsize);
-}
-
-
-/* This function is called indirectly from the freeres code in libc. */
-void
-__free_stack_cache (void)
-{
- free_stacks (0);
+ __free_stacks (stack_cache_maxsize);
}
@@ -849,8 +841,6 @@ __reclaim_stacks (void)
elem->next->prev = elem->prev;
elem->prev->next = elem->next;
}
-
- in_flight_stack = 0;
}
/* Mark all stacks except the still running one as free. */
@@ -913,11 +903,13 @@ __reclaim_stacks (void)
if (__builtin_expect (THREAD_GETMEM (self, user_stack), 0))
list_add (&self->list, &__stack_user);
else
- stack_list_add (&self->list, &stack_used);
+ list_add (&self->list, &stack_used);
/* There is one thread running. */
__nptl_nthreads = 1;
+ in_flight_stack = 0;
+
/* Initialize the lock. */
stack_cache_lock = LLL_LOCK_INITIALIZER;
}