diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-19 12:09:14 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-19 12:09:14 +0000 |
commit | 67d0fbd03f46edcc0a6fb2a65409ebfa6be25534 (patch) | |
tree | 688c78e8fbf9b97d2e43f31c969ba27c3c3af6e0 /thread_pthread.c | |
parent | 3c95aacfcba7ba30006d128d0f944fce85a79dd7 (diff) |
* 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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |