diff options
author | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-29 01:10:52 +0000 |
---|---|---|
committer | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-29 01:10:52 +0000 |
commit | f8ab438738039dd9656503a262e5a02e4be05ea8 (patch) | |
tree | 5d947d7f6decd27e46f109202a683b65335022f2 /libstdc++-v3/testsuite/thread/pthread5.cc | |
parent | 826e2a1a123fc5a884cf8d0af3f961ba0431a88c (diff) | |
download | ppe42-gcc-f8ab438738039dd9656503a262e5a02e4be05ea8.tar.gz ppe42-gcc-f8ab438738039dd9656503a262e5a02e4be05ea8.zip |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58608 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/thread/pthread5.cc')
-rw-r--r-- | libstdc++-v3/testsuite/thread/pthread5.cc | 6 |
1 files changed, 6 insertions, 0 deletions
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 <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++) { |