Commit 799cff46 by Marius Strobl Committed by Gerald Pfeifer

gthr-posix.h (__gthread_active_p): Use the Solaris implementation for FreeBSD as well.

	* gthr-posix.h (__gthread_active_p): Use the Solaris implementation
	for FreeBSD as well.
	* gthr-posix95.h: Likewise.

From-SVN: r134423
parent 57b256d9
2008-04-18 Marius Strobl <marius@FreeBSD.org>
* gthr-posix.h (__gthread_active_p): Use the Solaris implementation
for FreeBSD as well.
* gthr-posix95.h: Likewise.
2008-04-17 Richard Sandiford <rsandifo@nildram.co.uk> 2008-04-17 Richard Sandiford <rsandifo@nildram.co.uk>
PR rtl-optimization/35838 PR rtl-optimization/35838
......
...@@ -158,9 +158,12 @@ __gthrw(pthread_setschedparam) ...@@ -158,9 +158,12 @@ __gthrw(pthread_setschedparam)
it is passed so we cannot pretend that the interface is active if -pthreads 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 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 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; static volatile int __gthread_active = -1;
...@@ -203,7 +206,7 @@ __gthread_active_p (void) ...@@ -203,7 +206,7 @@ __gthread_active_p (void)
return __gthread_active_latest_value != 0; return __gthread_active_latest_value != 0;
} }
#else /* not Solaris */ #else /* neither FreeBSD nor Solaris */
static inline int static inline int
__gthread_active_p (void) __gthread_active_p (void)
...@@ -213,7 +216,7 @@ __gthread_active_p (void) ...@@ -213,7 +216,7 @@ __gthread_active_p (void)
return __gthread_active_ptr != 0; return __gthread_active_ptr != 0;
} }
#endif /* Solaris */ #endif /* FreeBSD or Solaris */
#else /* not SUPPORTS_WEAK */ #else /* not SUPPORTS_WEAK */
......
...@@ -121,9 +121,12 @@ __gthrw(pthread_setschedparam) ...@@ -121,9 +121,12 @@ __gthrw(pthread_setschedparam)
it is passed so we cannot pretend that the interface is active if -pthreads 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 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 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; static volatile int __gthread_active = -1;
...@@ -166,7 +169,7 @@ __gthread_active_p (void) ...@@ -166,7 +169,7 @@ __gthread_active_p (void)
return __gthread_active_latest_value != 0; return __gthread_active_latest_value != 0;
} }
#else /* not Solaris */ #else /* neither FreeBSD nor Solaris */
static inline int static inline int
__gthread_active_p (void) __gthread_active_p (void)
...@@ -176,7 +179,7 @@ __gthread_active_p (void) ...@@ -176,7 +179,7 @@ __gthread_active_p (void)
return __gthread_active_ptr != 0; return __gthread_active_ptr != 0;
} }
#endif /* Solaris */ #endif /* FreeBSD or Solaris */
#else /* not SUPPORTS_WEAK */ #else /* not SUPPORTS_WEAK */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment