From af1871fba4fc253b5a31e4a0eed667fe79f534d7 Mon Sep 17 00:00:00 2001 From: rpj Date: Thu, 18 Sep 2003 02:31:39 +0000 Subject: Cleanup and fixes to thread priority management. Other minor changes. --- pthread_getschedparam.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'pthread_getschedparam.c') diff --git a/pthread_getschedparam.c b/pthread_getschedparam.c index 28800c7..ac02775 100644 --- a/pthread_getschedparam.c +++ b/pthread_getschedparam.c @@ -42,7 +42,6 @@ int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param) { - int prio; int result; /* Validate the thread id. */ @@ -64,13 +63,13 @@ pthread_getschedparam(pthread_t thread, int *policy, /* Fill out the policy. */ *policy = SCHED_OTHER; - /* Fill out the sched_param structure. */ - prio = GetThreadPriority(thread->threadH); - if (prio == THREAD_PRIORITY_ERROR_RETURN) - { - return EINVAL; - } - - param->sched_priority = prio; + /* + * This function must return the priority value set by + * the most recent pthread_setschedparam() or pthread_create() + * for the target thread. It must not return the actual thread + * priority as altered by any system priority adjustments etc. + */ + param->sched_priority = thread->sched_priority; + return 0; } -- cgit v1.2.3