diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-08 15:04:38 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-08 15:04:38 +0000 |
commit | dc915fcef837f3bc041cf65997c7f8527baa4e6e (patch) | |
tree | 27d3b82d21dd8bcbe0c49eef67e5a230f30cba82 /gcc/gthr-posix95.h | |
parent | 7a13e4e3cc81d350e04804247cc04a9a751f8981 (diff) | |
download | gcc-dc915fcef837f3bc041cf65997c7f8527baa4e6e.tar.gz |
PR boehm-gc/34544
* gthr-posix.h (__gthread_start): Delete.
(__gthread_active_init): Use pthread_default_stacksize_np instead of
pthread_create to determine if hpux pthreads are active.
* gthr-posix95.h (__gthread_start): Delete.
(__gthread_active_init): Likewise use pthread_default_stacksize_np.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163003 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-posix95.h')
-rw-r--r-- | gcc/gthr-posix95.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/gcc/gthr-posix95.h b/gcc/gthr-posix95.h index 55e254eb21f..d0e0f995f1b 100644 --- a/gcc/gthr-posix95.h +++ b/gcc/gthr-posix95.h @@ -197,32 +197,18 @@ __gthread_active_p (void) static volatile int __gthread_active = -1; -static void * -__gthread_start (void *arg __attribute__((unused))) -{ - return NULL; -} - static void __gthread_active_init (void) __attribute__((noinline)); static void __gthread_active_init (void) { static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER; - pthread_t t; - pthread_attr_t a; - int result; + size_t __s; __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex); if (__gthread_active < 0) { - __gthrw_(pthread_attr_init) (&a); - __gthrw_(pthread_attr_setdetachstate) (&a, PTHREAD_CREATE_DETACHED); - result = __gthrw_(pthread_create) (&t, &a, __gthread_start, NULL); - if (result != ENOSYS) - __gthread_active = 1; - else - __gthread_active = 0; - __gthrw_(pthread_attr_destroy) (&a); + pthread_default_stacksize_np (0, &__s); + __gthread_active = __s ? 1 : 0; } __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex); } |