* testsuite/thread/pthread5.cc: Include <unistd.h>
authorthorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Oct 2002 01:10:52 +0000 (01:10 +0000)
committerthorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Oct 2002 01:10:52 +0000 (01:10 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/thread/pthread5.cc

index 690e25c..55b79be 100644 (file)
@@ -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.
index 85d332e..a3987c8 100644 (file)
 // 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++)
     {