diff options
author | Marius Strobl <marius@FreeBSD.org> | 2008-05-05 22:15:58 +0000 |
---|---|---|
committer | Gerald Pfeifer <gerald@pfeifer.com> | 2008-05-05 22:15:58 +0000 |
commit | 55a11618205b896c77926d4150331e979f62e9f5 (patch) | |
tree | 702a93e690c735ceff52b92b3519ca03a0dd6c0b | |
parent | e20c7d24e0c772666559241c483842bc825ffdb9 (diff) |
* gthr-posix.h (__gthread_active_p): Use the Solaris implementation
for FreeBSD as well.
* gthr-posix95.h: Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch@134958 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gthr-posix.h | 11 | ||||
-rw-r--r-- | gcc/gthr-posix95.h | 11 |
3 files changed, 20 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 104cda32e7d..a80c4992aa9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-05-05 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-05 Ira Rosen <irar@il.ibm.com> PR tree-optimization/36119 diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h index ad6822e26ad..a90dc11e639 100644 --- a/gcc/gthr-posix.h +++ b/gcc/gthr-posix.h @@ -158,9 +158,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; @@ -203,7 +206,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) @@ -213,7 +216,7 @@ __gthread_active_p (void) return __gthread_active_ptr != 0; } -#endif /* Solaris */ +#endif /* FreeBSD or Solaris */ #else /* not SUPPORTS_WEAK */ diff --git a/gcc/gthr-posix95.h b/gcc/gthr-posix95.h index d2d68dbfb83..9d6939eaf91 100644 --- a/gcc/gthr-posix95.h +++ b/gcc/gthr-posix95.h @@ -121,9 +121,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; @@ -166,7 +169,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) @@ -176,7 +179,7 @@ __gthread_active_p (void) return __gthread_active_ptr != 0; } -#endif /* Solaris */ +#endif /* FreeBSD or Solaris */ #else /* not SUPPORTS_WEAK */ |