]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gthr-posix.h (__gthread_active_p): Use the Solaris implementation for FreeBSD as...
authorMarius Strobl <marius@FreeBSD.org>
Sun, 25 May 2008 20:50:05 +0000 (20:50 +0000)
committerGerald Pfeifer <gerald@gcc.gnu.org>
Sun, 25 May 2008 20:50:05 +0000 (20:50 +0000)
* gthr-posix.h (__gthread_active_p): Use the Solaris implementation
for FreeBSD as well.
* gthr-posix95.h: Likewise

From-SVN: r135880

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

index ab330d52284052ec9257bd1064769c0fbc68e2e5..b1a344694bd7c3fc7e53645db1d72da191746ce7 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-23  Marius Strobl <marius@FreeBSD.org>
+
+       * gthr-posix.h (__gthread_active_p): Use the Solaris implementation
+       for FreeBSD as well.
+       * gthr-posix95.h: Likewise.
+
 2008-05-20  Adam Nemet  <anemet@caviumnetworks.com>
 
        PR middle-end/36194
index 47d38a320bae9a55c6856de9d14d4e7d0d06ccbd..fd1ce2204d386f0ef5f182ba7a417ff6540c5df8 100644 (file)
@@ -152,9 +152,12 @@ __gthrw(pthread_setschedparam)
    it is passed so we cannot pretend that the interface is active if -pthreads
    is not specified.  On Solaris 2.5.1, the interface is not exposed at all so
    we need to play the usual game with weak symbols.  On Solaris 10 and up, a
-   working interface is always exposed.  */
+   working interface is always exposed.  On FreeBSD 6 and later, libc also
+   exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+   to 9 does.  FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+   which means the alternate __gthread_active_p below cannot be used there.  */
 
-#if defined(__sun) && defined(__svr4__)
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
 
 static volatile int __gthread_active = -1;
 
@@ -197,7 +200,7 @@ __gthread_active_p (void)
   return __gthread_active_latest_value != 0;
 }
 
-#else /* not Solaris */
+#else /* neither FreeBSD nor Solaris */
 
 static inline int
 __gthread_active_p (void)
@@ -207,7 +210,7 @@ __gthread_active_p (void)
   return __gthread_active_ptr != 0;
 }
 
-#endif /* Solaris */
+#endif /* FreeBSD or Solaris */
 
 #else /* not SUPPORTS_WEAK */
 
index fde264594f84da6800aa2e8a39fcefb7a4c44564..172439638afd68ce7b44737e7266b9e7d3799285 100644 (file)
@@ -115,9 +115,12 @@ __gthrw(pthread_setschedparam)
    it is passed so we cannot pretend that the interface is active if -pthreads
    is not specified.  On Solaris 2.5.1, the interface is not exposed at all so
    we need to play the usual game with weak symbols.  On Solaris 10 and up, a
-   working interface is always exposed.  */
+   working interface is always exposed.  On FreeBSD 6 and later, libc also
+   exposes a dummy POSIX threads interface, similar to what Solaris 2.6 up
+   to 9 does.  FreeBSD >= 700014 even provides a pthread_cancel stub in libc,
+   which means the alternate __gthread_active_p below cannot be used there.  */
 
-#if defined(__sun) && defined(__svr4__)
+#if defined(__FreeBSD__) || (defined(__sun) && defined(__svr4__))
 
 static volatile int __gthread_active = -1;
 
@@ -160,7 +163,7 @@ __gthread_active_p (void)
   return __gthread_active_latest_value != 0;
 }
 
-#else /* not Solaris */
+#else /* neither FreeBSD nor Solaris */
 
 static inline int
 __gthread_active_p (void)
@@ -170,7 +173,7 @@ __gthread_active_p (void)
   return __gthread_active_ptr != 0;
 }
 
-#endif /* Solaris */
+#endif /* FreeBSD or Solaris */
 
 #else /* not SUPPORTS_WEAK */