diff options
author | Jason Thorpe <thorpej@wasabisystems.com> | 2002-10-29 01:10:52 +0000 |
---|---|---|
committer | Jason Thorpe <thorpej@gcc.gnu.org> | 2002-10-29 01:10:52 +0000 |
commit | 17a7afe04b966028996bcb5a9d1bce29c2093b95 (patch) | |
tree | 5d947d7f6decd27e46f109202a683b65335022f2 | |
parent | 761642ea46a9a232176be518d2b0fcdd3312487a (diff) | |
download | gcc-17a7afe04b966028996bcb5a9d1bce29c2093b95.zip gcc-17a7afe04b966028996bcb5a9d1bce29c2093b95.tar.gz gcc-17a7afe04b966028996bcb5a9d1bce29c2093b95.tar.bz2 |
pthread5.cc: Include <unistd.h> if _GLIBCPP_HAVE_UNISTD_H is defined.
* testsuite/thread/pthread5.cc: Include <unistd.h>
if _GLIBCPP_HAVE_UNISTD_H is defined.
(main): Only use pthread_attr_setscope if
_POSIX_THREAD_PRIORITY_SCHEDULING is defined.
From-SVN: r58608
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/thread/pthread5.cc | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 690e25c..55b79be 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2002-10-28 Jason Thorpe <thorpej@wasabisystems.com> + * testsuite/thread/pthread5.cc: Include <unistd.h> + 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 <thorpej@wasabisystems.com> + * testsuite/thread/pthread1.cc: Enable on *-*-netbsd*. * testsuite/thread/pthread2.cc: Likewise. * testsuite/thread/pthread3.cc: Likewise. diff --git a/libstdc++-v3/testsuite/thread/pthread5.cc b/libstdc++-v3/testsuite/thread/pthread5.cc index 85d332e..a3987c8 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 <unistd.h> // 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++) { |