From 158ea87fba909161a084c29feff29a168725fe4e Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 7 May 2012 18:01:20 +0200 Subject: first priority donation implementation --- threads/thread.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'threads/thread.h') diff --git a/threads/thread.h b/threads/thread.h index 4ba5ef2..a6ef25d 100644 --- a/threads/thread.h +++ b/threads/thread.h @@ -107,6 +107,10 @@ struct thread unsigned magic; /* Detects stack overflow. */ int64_t wakeup_tick; /* absolute tick when to wake up the thread */ + + int is_donated; /* flag if threads priority has been donated by another thread */ + int saved_priority; /* saved base priority in case of priority dontation */ + struct list locks; /* list of locks we currently hold */ }; /* If false (default), use round-robin scheduler. @@ -114,6 +118,9 @@ struct thread Controlled by kernel command-line option "-o mlfqs". */ extern bool thread_mlfqs; +bool priority_list_cmp_greater (const struct list_elem *a, const struct list_elem *b, + void *aux); + void thread_init (void); void thread_start (void); @@ -139,6 +146,9 @@ void thread_foreach (thread_action_func *, void *); int thread_get_priority (void); void thread_set_priority (int); +void thread_other_set_priority (struct thread *t, int new_priority); +void thread_donate_priority (struct thread *donator, struct thread *donee); +void thread_donation_pass_back (void); int thread_get_nice (void); void thread_set_nice (int); -- cgit v1.2.3