summaryrefslogtreecommitdiff
path: root/sched.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-08-06 05:39:14 +0000
committerrpj <rpj>1998-08-06 05:39:14 +0000
commit511e3b586fb74bb0cd7359c51069d03f77d88b08 (patch)
tree3ba27cf626af1fc723d1a77374e042743d63e721 /sched.c
parent9ff4d7a4815f0e20f1dc95e9a9e91b55eee7459a (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.
Diffstat (limited to 'sched.c')
-rw-r--r--sched.c15
1 files changed, 11 insertions, 4 deletions
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;
}