From 67d0fbd03f46edcc0a6fb2a65409ebfa6be25534 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 19 May 2008 12:09:14 +0000 Subject: * thread_pthread.c (native_thread_apply_priority): fix argument range check. [ruby-dev:33124] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'thread_pthread.c') diff --git a/thread_pthread.c b/thread_pthread.c index 5ea391abd4..58ce378841 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -358,12 +358,12 @@ native_thread_apply_priority(rb_thread_t *th) max = sched_get_priority_max(policy); min = sched_get_priority_min(policy); - if (min < priority) { - priority = max; - } - else if (max > priority) { + if (min > priority) { priority = min; } + else if (max < priority) { + priority = max; + } sp.sched_priority = priority; pthread_setschedparam(th->thread_id, policy, &sp); -- cgit v1.2.3