diff options
author | bje <bje> | 1998-07-23 14:23:46 +0000 |
---|---|---|
committer | bje <bje> | 1998-07-23 14:23:46 +0000 |
commit | 55d4602d22dc7d8fb274df3abeb19b2d16230ff1 (patch) | |
tree | 6507b1ef22a76c02614b527aa688b455fd25bd0d | |
parent | d0c8ee6a9ee8d7faef6cf9353c1244b9906cd743 (diff) |
1998-07-24 Ben Elliston <bje@cygnus.com>
* sched.c: New file.
-rw-r--r-- | sched.c | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -0,0 +1,45 @@ +/* + * sched.c + * + * Description: + * POSIX thread functions that deal with thread scheduling. + */ + +#include "pthread.h" + +int +pthread_attr_setschedparam(pthread_attr_t *attr, + const struct sched_param *param) +{ + if (is_attr(attr) != 0 || param == NULL) + { + return EINVAL; + } + + attr->priority = param->sched_priority; + return 0; +} + +int pthread_attr_getschedparam(const pthread_attr_t *attr, + struct sched_param *param) +{ + if (is_attr(attr) != 0 || param == NULL) + { + return EINVAL; + } + + param->sched_priority = attr->priority; + return 0; +} + +int sched_get_priority_max(int policy) +{ + /* This is independent of scheduling policy in Win32. */ + return THREAD_PRIORITY_HIGHEST; +} + +int sched_get_priority_min(int policy) +{ + /* This is independent of scheduling policy in Win32. */ + return THREAD_PRIORITY_LOWEST; +} |