summaryrefslogtreecommitdiff
path: root/gcc/gthr-posix.h
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-28 20:18:23 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-28 20:18:23 +0000
commita55f666d97f9a33369f124946e6f22c023335692 (patch)
tree5ddb619763dd5ccc65476b1eed3ee14d276d762c /gcc/gthr-posix.h
parenta116ab2055e2d13cffe246c77b8442056e579632 (diff)
downloadgcc-a55f666d97f9a33369f124946e6f22c023335692.tar.gz
2004-05-28 Andrew Pinski <pinskia@physics.uc.edu>
* gthr-posix.h: Check for _POSIX_PRIORITY_SCHEDULING when checking for _POSIX_THREAD_PRIORITY_SCHEDULING. Remove comment about not checking for _POSIX_PRIORITY_SCHEDULING. * gthr-posix.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82376 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-posix.h')
-rw-r--r--gcc/gthr-posix.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index 88234daae93..e2b5a573999 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -74,12 +74,12 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_mutex_init
#pragma weak pthread_mutex_destroy
#pragma weak pthread_self
-/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but
- we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block. */
+#ifdef _POSIX_PRIORITY_SCHEDULING
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
#pragma weak sched_get_priority_max
#pragma weak sched_get_priority_min
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
#pragma weak sched_yield
#pragma weak pthread_attr_destroy
#pragma weak pthread_attr_init
@@ -187,6 +187,7 @@ __gthread_objc_thread_set_priority (int priority)
return -1;
else
{
+#ifdef _POSIX_PRIORITY_SCHEDULING
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
pthread_t thread_id = pthread_self ();
int policy;
@@ -216,6 +217,7 @@ __gthread_objc_thread_set_priority (int priority)
return 0;
}
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
return -1;
}
}
@@ -224,6 +226,7 @@ __gthread_objc_thread_set_priority (int priority)
static inline int
__gthread_objc_thread_get_priority (void)
{
+#ifdef _POSIX_PRIORITY_SCHEDULING
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
if (__gthread_active_p ())
{
@@ -237,6 +240,7 @@ __gthread_objc_thread_get_priority (void)
}
else
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
+#endif /* _POSIX_PRIORITY_SCHEDULING */
return OBJC_THREAD_INTERACTIVE_PRIORITY;
}