]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Sat, 14 Aug 2010 14:42:43 +0000 (14:42 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 14 Aug 2010 14:42:43 +0000 (14:42 +0000)
2010-08-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

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.

From-SVN: r163243

gcc/ChangeLog
gcc/gthr-posix.h
gcc/gthr-posix95.h

index e33f5e6f8a0bd8bf5ec70f26fd1f06c4b60b58ed..0416f0c9d2c74e00b729415885508e6802a1ca34 100644 (file)
@@ -1,3 +1,15 @@
+2010-08-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       Revert:
+       2010-08-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+       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.
+
 2010-08-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/45262
index f7449810f98a639a6b5337b84fa8081572c24a5e..82a3c581c0a0e9d8b0adf99d9611e073f66eedc9 100644 (file)
@@ -263,18 +263,32 @@ __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;
-  size_t __s;
+  pthread_t __t;
+  pthread_attr_t __a;
+  int __result;
 
   __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
   if (__gthread_active < 0)
     {
-      pthread_default_stacksize_np (0, &__s);
-      __gthread_active = __s ? 1 : 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);
     }
   __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
 }
index 03237668a32278e869eea020f2c9007a72ca3637..8772c977a28bc48eaa99036506165230a8b81858 100644 (file)
@@ -197,18 +197,32 @@ __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;
-  size_t __s;
+  pthread_t t;
+  pthread_attr_t a;
+  int result;
 
   __gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
   if (__gthread_active < 0)
     {
-      pthread_default_stacksize_np (0, &__s);
-      __gthread_active = __s ? 1 : 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);
     }
   __gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
 }