diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-06-22 22:06:35 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-06-22 22:06:35 +0200 |
commit | 0c51836d012787ac19739f0fe1c61ef7b2af4231 (patch) | |
tree | 8e8987effe179073c598fe3343d892dadff24a6a /boehm-gc | |
parent | 5e33addbb6bf715965771b8bcadc038f60dfcb05 (diff) | |
download | gcc-0c51836d012787ac19739f0fe1c61ef7b2af4231.zip gcc-0c51836d012787ac19739f0fe1c61ef7b2af4231.tar.gz gcc-0c51836d012787ac19739f0fe1c61ef7b2af4231.tar.bz2 |
pthread_support.c (GC_get_thread_stack_base): Handle pthread_getattr_np failures.
* pthread_support.c (GC_get_thread_stack_base): Handle
pthread_getattr_np failures.
From-SVN: r125957
Diffstat (limited to 'boehm-gc')
-rw-r--r-- | boehm-gc/ChangeLog | 5 | ||||
-rw-r--r-- | boehm-gc/pthread_support.c | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 89e48b9..f140791 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,8 @@ +2007-06-22 Jakub Jelinek <jakub@redhat.com> + + * pthread_support.c (GC_get_thread_stack_base): Handle + pthread_getattr_np failures. + 2007-06-02 Paolo Bonzini <bonzini@gnu.org> * configure: Regenerate. diff --git a/boehm-gc/pthread_support.c b/boehm-gc/pthread_support.c index bbda852..f0a58c8 100644 --- a/boehm-gc/pthread_support.c +++ b/boehm-gc/pthread_support.c @@ -1135,7 +1135,13 @@ GC_PTR GC_get_thread_stack_base() size_t stack_size; my_pthread = pthread_self(); - pthread_getattr_np (my_pthread, &attr); + if (pthread_getattr_np (my_pthread, &attr) != 0) + { +# ifdef DEBUG_THREADS + GC_printf1("Can not determine stack base for attached thread"); +# endif + return 0; + } pthread_attr_getstack (&attr, (void **) &stack_addr, &stack_size); pthread_attr_destroy (&attr); |