1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00
* include/stdlib.h: Add prototype for __cxa_atexit.
This commit is contained in:
Ulrich Drepper
2000-03-20 07:07:18 +00:00
parent 41a173e1e3
commit a6a478e9f9
4 changed files with 19 additions and 1 deletions

View File

@@ -308,6 +308,8 @@ __libc_allocate_rtsig (int high)
static void pthread_initialize(void) __attribute__((constructor));
extern void *__dso_handle __attribute__ ((weak));
static void pthread_initialize(void)
{
struct sigaction sa;
@@ -387,7 +389,13 @@ static void pthread_initialize(void)
/* Register an exit function to kill all other threads. */
/* Do it early so that user-registered atexit functions are called
before pthread_exit_process. */
__on_exit(pthread_exit_process, NULL);
if (__dso_handle)
/* The cast is a bit unclean. The function expects two arguments but
we can only pass one. Fortunately this is not a problem since the
second argument of `pthread_exit_process' is simply ignored. */
__cxa_atexit((void (*) (void *)) pthread_exit_process, NULL, __dso_handle);
else
on_exit (pthread_exit_process, NULL);
}
void __pthread_initialize(void)