diff options
author | rpj <rpj> | 1998-08-06 05:39:14 +0000 |
---|---|---|
committer | rpj <rpj> | 1998-08-06 05:39:14 +0000 |
commit | 511e3b586fb74bb0cd7359c51069d03f77d88b08 (patch) | |
tree | 3ba27cf626af1fc723d1a77374e042743d63e721 | |
parent | 9ff4d7a4815f0e20f1dc95e9a9e91b55eee7459a (diff) |
Thu Aug 6 15:19:22 1998 Ross Johnson <rpj@swan.canberra.edu.au>
* 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.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | sched.c | 15 | ||||
-rw-r--r-- | windows.h | 8 |
3 files changed, 30 insertions, 5 deletions
@@ -1,3 +1,15 @@ +Thu Aug 6 15:19:22 1998 Ross Johnson <rpj@swan.canberra.edu.au> + + * 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. + Tue Aug 4 16:57:58 1998 Ross Johnson <rpj@swan.canberra.edu.au> * private.c (_pthread_delete_thread): Fix typo. Add missing ';'. @@ -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; } @@ -38,7 +38,13 @@ /* Priority levels */ enum { - THREAD_PRIORITY_NORMAL + THREAD_PRIORITY_LOWEST, + THREAD_PRIORITY_NORMAL, + THREAD_PRIORITY_HIGHEST +}; + +enum { + THREAD_PRIORITY_ERROR_RETURN }; /* Error numbers */ |