From a1260d92a7e3c11e1db74ad7007332f87fc1b690 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 1 Aug 2006 06:40:11 +0000 Subject: * stdlib/test-canon.c (do_test): Close fd before unlinking file so that directory is empty even on non-POSIX filesystems. --- nptl/allocatestack.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'nptl/allocatestack.c') diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index a3ed1a33d3..4a1cd18481 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -742,9 +742,7 @@ __reclaim_stacks (void) list_t *runp; list_for_each (runp, &stack_used) { - struct pthread *curp; - - curp = list_entry (runp, struct pthread, list); + struct pthread *curp = list_entry (runp, struct pthread, list); if (curp != self) { /* This marks the stack as free. */ @@ -758,6 +756,13 @@ __reclaim_stacks (void) } } + /* Reset the PIDs in any cached stacks. */ + list_for_each (runp, &stack_cache) + { + struct pthread *curp = list_entry (runp, struct pthread, list); + curp->pid = self->pid; + } + /* Add the stack of all running threads to the cache. */ list_splice (&stack_used, &stack_cache); -- cgit 1.4.1