From: Jason Thorpe Date: Tue, 29 Oct 2002 01:10:52 +0000 (+0000) Subject: pthread5.cc: Include if _GLIBCPP_HAVE_UNISTD_H is defined. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17a7afe04b966028996bcb5a9d1bce29c2093b95;p=gcc.git pthread5.cc: Include if _GLIBCPP_HAVE_UNISTD_H is defined. * testsuite/thread/pthread5.cc: Include if _GLIBCPP_HAVE_UNISTD_H is defined. (main): Only use pthread_attr_setscope if _POSIX_THREAD_PRIORITY_SCHEDULING is defined. From-SVN: r58608 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 690e25ca7b7..55b79be1a9a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2002-10-28 Jason Thorpe + + * testsuite/thread/pthread5.cc: Include + if _GLIBCPP_HAVE_UNISTD_H is defined. + (main): Only use pthread_attr_setscope if + _POSIX_THREAD_PRIORITY_SCHEDULING is defined. + 2002-10-28 Jason Thorpe * testsuite/thread/pthread1.cc: Enable on *-*-netbsd*. diff --git a/libstdc++-v3/testsuite/thread/pthread5.cc b/libstdc++-v3/testsuite/thread/pthread5.cc index 85d332efe20..a3987c8876e 100644 --- a/libstdc++-v3/testsuite/thread/pthread5.cc +++ b/libstdc++-v3/testsuite/thread/pthread5.cc @@ -32,6 +32,10 @@ // configured for the port, then it is picked up free from STL headers. #if __GTHREADS +#ifdef _GLIBCPP_HAVE_UNISTD_H +#include // To test for _POSIX_THREAD_PRIORITY_SCHEDULING +#endif + using namespace std; #define NTHREADS 8 @@ -97,7 +101,9 @@ main (int argc, char *argv[]) pthread_attr_t tattr; int ret = pthread_attr_init (&tattr); +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING ret = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM); +#endif for (worker = 0; worker < NTHREADS; worker++) {