mirror of git://gcc.gnu.org/git/gcc.git
re PR boehm-gc/34544 (pthread_default_stacksize_np failed.)
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: r163003
This commit is contained in:
parent
71234632dd
commit
cf00499e19
|
@ -1,3 +1,12 @@
|
||||||
|
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-08 Kai Tietz <kai.tietz@onevision.com>
|
2010-08-08 Kai Tietz <kai.tietz@onevision.com>
|
||||||
|
|
||||||
* config/i386/mingw32.h ((EXTRA_OS_CPP_BUILTINS): Define
|
* config/i386/mingw32.h ((EXTRA_OS_CPP_BUILTINS): Define
|
||||||
|
|
|
@ -273,32 +273,18 @@ __gthread_active_p (void)
|
||||||
|
|
||||||
static volatile int __gthread_active = -1;
|
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) __attribute__((noinline));
|
||||||
static void
|
static void
|
||||||
__gthread_active_init (void)
|
__gthread_active_init (void)
|
||||||
{
|
{
|
||||||
static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
pthread_t __t;
|
size_t __s;
|
||||||
pthread_attr_t __a;
|
|
||||||
int __result;
|
|
||||||
|
|
||||||
__gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
|
__gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
|
||||||
if (__gthread_active < 0)
|
if (__gthread_active < 0)
|
||||||
{
|
{
|
||||||
__gthrw_(pthread_attr_init) (&__a);
|
pthread_default_stacksize_np (0, &__s);
|
||||||
__gthrw_(pthread_attr_setdetachstate) (&__a, PTHREAD_CREATE_DETACHED);
|
__gthread_active = __s ? 1 : 0;
|
||||||
__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);
|
__gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,32 +197,18 @@ __gthread_active_p (void)
|
||||||
|
|
||||||
static volatile int __gthread_active = -1;
|
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) __attribute__((noinline));
|
||||||
static void
|
static void
|
||||||
__gthread_active_init (void)
|
__gthread_active_init (void)
|
||||||
{
|
{
|
||||||
static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t __gthread_active_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
pthread_t t;
|
size_t __s;
|
||||||
pthread_attr_t a;
|
|
||||||
int result;
|
|
||||||
|
|
||||||
__gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
|
__gthrw_(pthread_mutex_lock) (&__gthread_active_mutex);
|
||||||
if (__gthread_active < 0)
|
if (__gthread_active < 0)
|
||||||
{
|
{
|
||||||
__gthrw_(pthread_attr_init) (&a);
|
pthread_default_stacksize_np (0, &__s);
|
||||||
__gthrw_(pthread_attr_setdetachstate) (&a, PTHREAD_CREATE_DETACHED);
|
__gthread_active = __s ? 1 : 0;
|
||||||
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);
|
__gthrw_(pthread_mutex_unlock) (&__gthread_active_mutex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue