posix-threads.cc: Include <unistd.h> if HAVE_UNISTD_H is defined.

* posix-threads.cc: Include <unistd.h> if HAVE_UNISTD_H is defined.
(_Jv_ThreadSetPriority): Test for _POSIX_THREAD_PRIORITY_SCHEDULING.

From-SVN: r63647
This commit is contained in:
Jason Thorpe 2003-03-02 01:24:40 +00:00 committed by Jason Thorpe
parent 3ccd3d7041
commit 66c4e25802
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2003-03-01 Jason Thorpe <thorpej@wasabisystems.com>
* posix-threads.cc: Include <unistd.h> if HAVE_UNISTD_H is defined.
(_Jv_ThreadSetPriority): Test for _POSIX_THREAD_PRIORITY_SCHEDULING.
2003-03-01 Ranjit Mathew <rmathew@hotmail.com> 2003-03-01 Ranjit Mathew <rmathew@hotmail.com>
* java/io/File.java (normalizePath): Remove trailing separator * java/io/File.java (normalizePath): Remove trailing separator

View File

@ -24,6 +24,9 @@ details. */
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING
#endif
#include <gcj/cni.h> #include <gcj/cni.h>
#include <jvm.h> #include <jvm.h>
@ -318,6 +321,7 @@ _Jv_ThreadDestroyData (_Jv_Thread_t *data)
void void
_Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio) _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio)
{ {
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
if (data->flags & FLAG_START) if (data->flags & FLAG_START)
{ {
struct sched_param param; struct sched_param param;
@ -325,6 +329,7 @@ _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio)
param.sched_priority = prio; param.sched_priority = prio;
pthread_setschedparam (data->thread, SCHED_RR, &param); pthread_setschedparam (data->thread, SCHED_RR, &param);
} }
#endif
} }
void void