]> granicus.if.org Git - gc/commitdiff
* pthread_support.c (GC_get_thread_stack_base): Handle
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Jun 2007 20:06:35 +0000 (20:06 +0000)
committerguest <ivmai@mail.ru>
Fri, 29 Jul 2011 06:54:28 +0000 (10:54 +0400)
pthread_getattr_np failures.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125957 138bc75d-0d04-0410-961f-82ee72b054a4

ChangeLog
pthread_support.c

index 89e48b942ed8be3d0d9511172dcfb556ae0bf97b..f140791a56f02047b7be2bda4dcffd9416b5ad31 100644 (file)
--- a/ChangeLog
+++ b/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.
index bbda8522c03072f4bc7a54d9c8fa517c95d1971a..f0a58c886a3a33e1368cd18de4999370bcaee551 100644 (file)
@@ -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);