summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-01-31 21:20:49 +0100
committerRichard Braun <rbraun@sceen.net>2017-01-31 21:20:49 +0100
commit73573e460ab7fd85e0858c5e188c67e10fc2dc56 (patch)
treed63ae57b0ba6fbb7e22a6a7c39a5b70841300240 /kern/thread.h
parent1d0f9ae0fb69c388c35597301660a12cd2a7c27a (diff)
kern/thread: make priority a generic thread property
Diffstat (limited to 'kern/thread.h')
-rw-r--r--kern/thread.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/kern/thread.h b/kern/thread.h
index 104e2722..0d9c7861 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -248,12 +248,23 @@ char thread_state_to_chr(const struct thread *thread);
*/
const char * thread_schedclass_to_str(const struct thread *thread);
-/*
- * Return the priority of a thread.
- *
- * If the scheduling class doesn't use a priority, return 0.
- */
-unsigned short thread_schedprio(const struct thread *thread);
+static inline unsigned char
+thread_sched_policy(const struct thread *thread)
+{
+ return thread->sched_data.sched_policy;
+}
+
+static inline unsigned char
+thread_sched_class(const struct thread *thread)
+{
+ return thread->sched_data.sched_class;
+}
+
+static inline unsigned short
+thread_priority(const struct thread *thread)
+{
+ return thread->sched_data.priority;
+}
static inline struct thread *
thread_from_tcb(struct tcb *tcb)