summaryrefslogtreecommitdiff
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
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.
-rw-r--r--ChangeLog12
-rw-r--r--sched.c15
-rw-r--r--windows.h8
3 files changed, 30 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 051a348..1b3974b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 ';'.
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;
}
diff --git a/windows.h b/windows.h
index e9af0ff..b94ac05 100644
--- a/windows.h
+++ b/windows.h
@@ -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 */