From 511e3b586fb74bb0cd7359c51069d03f77d88b08 Mon Sep 17 00:00:00 2001 From: rpj Date: Thu, 6 Aug 1998 05:39:14 +0000 Subject: Thu Aug 6 15:19:22 1998 Ross Johnson * windows.h (THREAD_PRIORITY_ERROR_RETURN): Add. (THREAD_PRIORITY_LOWEST): Add. (THREAD_PRIORITY_HIGHEST): Add. * sched.c (is_attr): Add function. (implement.h): Add include. (pthread_setschedparam): Rename all instances of "sched_policy" to "sched_priority". (pthread_getschedparam): Ditto. --- sched.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sched.c') diff --git a/sched.c b/sched.c index e29e684..7153881 100644 --- a/sched.c +++ b/sched.c @@ -6,6 +6,13 @@ */ #include "pthread.h" +#include "implement.h" + +static int +is_attr(const pthread_attr_t *attr) +{ + return (attr == NULL || attr->valid != _PTHREAD_ATTR_VALID) ? 1 : 0; +} int pthread_attr_setschedparam(pthread_attr_t *attr, @@ -54,14 +61,14 @@ int pthread_setschedparam(pthread_t thread, int policy, } /* Validate priority level. */ - if (param->sched_policy < sched_get_priority_min(policy) || - param->sched_policy > sched_get_priority_max(policy)) + if (param->sched_priority < sched_get_priority_min(policy) || + param->sched_priority > sched_get_priority_max(policy)) { return EINVAL; } /* This is practically guaranteed to return TRUE. */ - (void) SetThreadPriority(thread->win32handle, param->sched_policy); + (void) SetThreadPriority(thread->win32handle, param->sched_priority); return 0; } @@ -92,7 +99,7 @@ int pthread_getschedparam(pthread_t thread, int *policy, return EINVAL; } - param->sched_policy = prio; + param->sched_priority = prio; return 0; } -- cgit v1.2.3