diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-21 19:54:01 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-21 19:54:01 +0000 |
commit | c3d22aafe2ea6e541c10236456731e16d71e05f5 (patch) | |
tree | 572d0ae3c24e3be1bc0c147e731c9efac7d01182 /gcc/gthr-posix.h | |
parent | 89c21b2fa07ccaeefcd9f13f1b0674f7881b79c4 (diff) | |
download | gcc-c3d22aafe2ea6e541c10236456731e16d71e05f5.tar.gz |
2008-04-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r134525
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@134526 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-posix.h')
-rw-r--r-- | gcc/gthr-posix.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h index a6c9ba3b54f..b16f9b31fe8 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 */ |