diff options
author | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-02 01:24:40 +0000 |
---|---|---|
committer | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-02 01:24:40 +0000 |
commit | ac787142717c501da2268d1992d85309eeeaea45 (patch) | |
tree | bf4affbe7e622a621a9117fd3016958831b7d322 /libjava/posix-threads.cc | |
parent | 2b72a6c3ce7672bc484d34ccaa89bc893bc03840 (diff) | |
download | gcc-ac787142717c501da2268d1992d85309eeeaea45.tar.gz |
* posix-threads.cc: Include <unistd.h> if HAVE_UNISTD_H is defined.
(_Jv_ThreadSetPriority): Test for _POSIX_THREAD_PRIORITY_SCHEDULING.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63647 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/posix-threads.cc')
-rw-r--r-- | libjava/posix-threads.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc index e92348bcc2c..656f483e96d 100644 --- a/libjava/posix-threads.cc +++ b/libjava/posix-threads.cc @@ -24,6 +24,9 @@ details. */ #include <signal.h> #include <errno.h> #include <limits.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING +#endif #include <gcj/cni.h> #include <jvm.h> @@ -318,6 +321,7 @@ _Jv_ThreadDestroyData (_Jv_Thread_t *data) void _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio) { +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING if (data->flags & FLAG_START) { struct sched_param param; @@ -325,6 +329,7 @@ _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio) param.sched_priority = prio; pthread_setschedparam (data->thread, SCHED_RR, ¶m); } +#endif } void |