summaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-20 10:14:16 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-20 10:14:16 +0000
commit25754b0a70927b887c3ab91ba6c57066500f6185 (patch)
tree844c1f204b84bfcb8ffca8eea675dcd56a115792 /thread_pthread.c
parente6a5803e41269d89f96734ed9fa1810569307645 (diff)
downloadruby-25754b0a70927b887c3ab91ba6c57066500f6185.tar.gz
ruby-25754b0a70927b887c3ab91ba6c57066500f6185.tar.xz
ruby-25754b0a70927b887c3ab91ba6c57066500f6185.zip
* thread_pthread.c (native_thread_apply_priority): check
_POSIX_PRIORITY_SCHEDULING for OpenBSD. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index feeffdf5d..feb569979 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