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
This commit is contained in:
parent
761642ea46
commit
17a7afe04b
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
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>
|
2002-10-28 Jason Thorpe <thorpej@wasabisystems.com>
|
||||||
|
|
||||||
* testsuite/thread/pthread1.cc: Enable on *-*-netbsd*.
|
* testsuite/thread/pthread1.cc: Enable on *-*-netbsd*.
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
// configured for the port, then it is picked up free from STL headers.
|
// configured for the port, then it is picked up free from STL headers.
|
||||||
|
|
||||||
#if __GTHREADS
|
#if __GTHREADS
|
||||||
|
#ifdef _GLIBCPP_HAVE_UNISTD_H
|
||||||
|
#include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define NTHREADS 8
|
#define NTHREADS 8
|
||||||
|
@ -97,7 +101,9 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
pthread_attr_t tattr;
|
pthread_attr_t tattr;
|
||||||
int ret = pthread_attr_init (&tattr);
|
int ret = pthread_attr_init (&tattr);
|
||||||
|
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
|
||||||
ret = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
|
ret = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (worker = 0; worker < NTHREADS; worker++)
|
for (worker = 0; worker < NTHREADS; worker++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue