gthr-posix.h (pthread_cancel): Don't declare if compiling against Bionic C library.
authorMaxim Kuvyrkov <maxim@codesourcery.com>
Thu, 27 May 2010 12:08:51 +0000 (12:08 +0000)
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>
Thu, 27 May 2010 12:08:51 +0000 (12:08 +0000)
* gthr-posix.h (pthread_cancel): Don't declare if compiling against
Bionic C library.
(__gthread_active_p): Check for pthread_create if compiling against
Bionic C library.

From-SVN: r159919

gcc/ChangeLog
gcc/gthr-posix.h

index 68fffda8e970ec7268f5ad11652f0e62f328134b..6d8c2e8df30218206d3655fc1635bc237730705d 100644 (file)
@@ -1,3 +1,10 @@
+2010-05-27  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+       * gthr-posix.h (pthread_cancel): Don't declare if compiling against
+       Bionic C library.
+       (__gthread_active_p): Check for pthread_create if compiling against
+       Bionic C library.
+
 2010-05-27  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        Support compilation for Android platform.  Reimplement -mandroid.
index 61b4dda4271a43ae97aed13a0b92b1695c9b8f2e..a7ce3111802075402ec50e8a0e15a90d13aa408f 100644 (file)
@@ -124,7 +124,9 @@ __gthrw(pthread_join)
 __gthrw(pthread_equal)
 __gthrw(pthread_self)
 __gthrw(pthread_detach)
+#ifndef __BIONIC__
 __gthrw(pthread_cancel)
+#endif
 __gthrw(sched_yield)
 
 __gthrw(pthread_mutex_lock)
@@ -238,7 +240,15 @@ static inline int
 __gthread_active_p (void)
 {
   static void *const __gthread_active_ptr
-    = __extension__ (void *) &__gthrw_(pthread_cancel);
+    = __extension__ (void *) &__gthrw_(
+/* Android's C library does not provide pthread_cancel, check for
+   `pthread_create' instead.  */
+#ifndef __BIONIC__
+                                      pthread_cancel
+#else
+                                      pthread_create
+#endif
+                                      );
   return __gthread_active_ptr != 0;
 }