diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-03-16 22:26:45 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-03-16 22:26:45 +0000 |
commit | a66f0958a1fbe5d64c3c77c01baee10bf23257dd (patch) | |
tree | 8bd667d88be5d0697fbcd2c01292b538abf5b91b /linuxthreads | |
parent | aeba9785a6e2e8dca120bb0b62b74ea1eda0a4a8 (diff) | |
download | glibc-a66f0958a1fbe5d64c3c77c01baee10bf23257dd.tar.gz glibc-a66f0958a1fbe5d64c3c77c01baee10bf23257dd.tar.xz glibc-a66f0958a1fbe5d64c3c77c01baee10bf23257dd.zip |
Update.
2001-03-16 Ulrich Drepper <drepper@redhat.com> * sysdeps/ieee754/ldbl-96/s_erfl.c: New file. Contributed by Stephen L. Moshier <moshier@na-net.ornl.gov>. * sysdeps/i386/fpu/libm-test-ulps: Adjust for addition of erfl and erfcl. * sysdeps/ia64/fpu/libm-test-ulps: Likewise. * sysdeps/unix/sysv/linux/ia64/swapcontext.c: New file.
Diffstat (limited to 'linuxthreads')
-rw-r--r-- | linuxthreads/ChangeLog | 9 | ||||
-rw-r--r-- | linuxthreads/attr.c | 11 | ||||
-rw-r--r-- | linuxthreads/internals.h | 1 | ||||
-rw-r--r-- | linuxthreads/pthread.c | 34 |
4 files changed, 31 insertions, 24 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 3eb7bcbdeb..8d680babb3 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,12 @@ +2001-02-23 Jakub Jelinek <jakub@redhat.com> + + * internals.h (__pthread_init_max_stacksize): New prototype. + * attr.c (__pthread_attr_setstacksize): Call + __pthread_init_max_stacksize if not yet initialized. + * pthread.c (__pthread_init_max_stacksize): New function. + (__pthread_initialize_manager): Call it. + Patch by <dtc@cmucl.cons.org>. + 2001-03-16 Ulrich Drepper <drepper@redhat.com> * attr.c (pthread_getattr_np): Fix __stacksize computation for IA-64. diff --git a/linuxthreads/attr.c b/linuxthreads/attr.c index 3553069c2e..623b9ba64d 100644 --- a/linuxthreads/attr.c +++ b/linuxthreads/attr.c @@ -193,16 +193,7 @@ int __pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) problem if the manager is already started and we determined it. If this hasn't happened, we have to find the limit outself. */ if (__pthread_max_stacksize == 0) - { - struct rlimit limit; - - getrlimit(RLIMIT_STACK, &limit); -# ifdef NEED_SEPARATE_REGISTER_STACK - __pthread_max_stacksize = limit.rlim_max / 2; -# else - __pthread_max_stacksize = limit.rlim_max; -# endif - } + __pthread_init_max_stacksize (); if (stacksize > __pthread_max_stacksize) return EINVAL; diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h index f3f8af2c8e..ba0c14d29d 100644 --- a/linuxthreads/internals.h +++ b/linuxthreads/internals.h @@ -430,6 +430,7 @@ static inline pthread_descr thread_self (void) extern void __pthread_destroy_specifics (void); extern void __pthread_perform_cleanup (void); +extern void __pthread_init_max_stacksize (void); extern int __pthread_initialize_manager (void); extern void __pthread_message (char * fmt, ...); extern int __pthread_manager (void *reqfd); diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index 5a2ade7446..b1c6186683 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -456,19 +456,10 @@ void __pthread_initialize(void) pthread_initialize(); } -int __pthread_initialize_manager(void) +void __pthread_init_max_stacksize(void) { - int manager_pipe[2]; - int pid; - struct pthread_request request; struct rlimit limit; - int max_stack; - -#ifndef HAVE_Z_NODELETE - if (__builtin_expect (&__dso_handle != NULL, 1)) - __cxa_atexit ((void (*) (void *)) pthread_atexit_retcode, NULL, - __dso_handle); -#endif + size_t max_stack; getrlimit(RLIMIT_STACK, &limit); #ifdef FLOATING_STACKS @@ -478,9 +469,7 @@ int __pthread_initialize_manager(void) max_stack = limit.rlim_cur / 2; # else max_stack = limit.rlim_cur; -#endif - - __pthread_max_stacksize = max_stack; +# endif #else /* Play with the stack size limit to make sure that no stack ever grows beyond STACK_SIZE minus one page (to act as a guard page). */ @@ -496,6 +485,23 @@ int __pthread_initialize_manager(void) setrlimit(RLIMIT_STACK, &limit); } #endif + __pthread_max_stacksize = max_stack; +} + +int __pthread_initialize_manager(void) +{ + int manager_pipe[2]; + int pid; + struct pthread_request request; + +#ifndef HAVE_Z_NODELETE + if (__builtin_expect (&__dso_handle != NULL, 1)) + __cxa_atexit ((void (*) (void *)) pthread_atexit_retcode, NULL, + __dso_handle); +#endif + + if (__pthread_max_stacksize == 0) + __pthread_init_max_stacksize (); /* If basic initialization not done yet (e.g. we're called from a constructor run before our constructor), do it now */ if (__pthread_initial_thread_bos == NULL) pthread_initialize(); |