From cb7e82a94aa8405ac650e12abdf52b8560e559bf Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 20 Dec 2007 10:14:16 +0000 Subject: [PATCH] * thread_pthread.c (native_thread_apply_priority): check _POSIX_PRIORITY_SCHEDULING for OpenBSD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ thread_pthread.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index ae2baab92b..d9c88ccc4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Dec 20 19:11:56 2007 Koichi Sasada + + * thread_pthread.c (native_thread_apply_priority): check + _POSIX_PRIORITY_SCHEDULING for OpenBSD. + Thu Dec 20 18:33:54 2007 Koichi Sasada * configure.in: add libthr for FreeBSD. diff --git a/thread_pthread.c b/thread_pthread.c index feeffdf5da..feb569979b 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -334,6 +334,7 @@ native_thread_join(pthread_t th) static void native_thread_apply_priority(rb_thread_t *th) { +#if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING > 0) struct sched_param sp; int policy; int priority = 0 - th->priority; @@ -351,6 +352,9 @@ native_thread_apply_priority(rb_thread_t *th) sp.sched_priority = priority; pthread_setschedparam(th->thread_id, policy, &sp); +#else + /* not touched */ +#endif } static void