aboutsummaryrefslogtreecommitdiff
path: root/nptl/init.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-01-29 20:38:04 +0000
committerUlrich Drepper <drepper@redhat.com>2009-01-29 20:38:04 +0000
commitcca50323b6a80283886c5fb6e2cff25f6c2d006b (patch)
tree3787ee6c3122d8692610861baba3db91b997e8d8 /nptl/init.c
parentcdf77dd87b27260d1aefbad18aaa169d4a3a6121 (diff)
downloadglibc-cca50323b6a80283886c5fb6e2cff25f6c2d006b.zip
glibc-cca50323b6a80283886c5fb6e2cff25f6c2d006b.tar.gz
glibc-cca50323b6a80283886c5fb6e2cff25f6c2d006b.tar.bz2
* allocatestack.c (__free_stacks): Renamed from free_stacks.
(__free_stack_cache): Removed. Change callers to call __free_stacks. * init.c (nptl_freeres): New function. (pthread_functions): Initialize ptr_freeres to nptl_freeres. * pthreadP.h: Don't declare __free_stack_cache. Declare __free_stacks. * sysdeps/pthread/unwind-forcedunwind.c (libgcc_s_handle): New variable. (pthread_cancel_init): Depend in libgcc_s_handle for decision to load DSO. Assign last. (__unwind_freeres): New function. * allocatestack.c (__reclaim_stacks): Reset in_flight_stack later for better debugging. No need to use stack_list_add here.
Diffstat (limited to 'nptl/init.c')
-rw-r--r--nptl/init.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/nptl/init.c b/nptl/init.c
index 7a6dec5..d0f1fc3 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -67,6 +67,8 @@ static const char nptl_version[] __attribute_used__ = VERSION;
extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
#endif
+static void nptl_freeres (void);
+
#ifdef SHARED
static const struct pthread_functions pthread_functions =
@@ -128,7 +130,7 @@ static const struct pthread_functions pthread_functions =
.ptr__nptl_deallocate_tsd = __nptl_deallocate_tsd,
.ptr__nptl_setxid = __nptl_setxid,
/* For now only the stack cache needs to be freed. */
- .ptr_freeres = __free_stack_cache
+ .ptr_freeres = nptl_freeres
};
# define ptr_pthread_functions &pthread_functions
#else
@@ -136,6 +138,18 @@ static const struct pthread_functions pthread_functions =
#endif
+/* This function is called indirectly from the freeres code in libc. */
+static void
+__libc_freeres_fn_section
+nptl_freeres (void)
+{
+#ifdef SHARED
+ __unwind_freeres ();
+#endif
+ __free_stacks (0);
+}
+
+
/* For asynchronous cancellation we use a signal. This is the handler. */
static void
sigcancel_handler (int sig, siginfo_t *si, void *ctx)