summaryrefslogtreecommitdiffstats
path: root/threads/thread.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2012-05-07 18:01:20 +0200
committermanuel <manuel@mausz.at>2012-05-07 18:01:20 +0200
commit158ea87fba909161a084c29feff29a168725fe4e (patch)
treece580f0fec9f4d5105e817ae11fded8015817574 /threads/thread.h
parent3d1e18466b44b2de06dd7c00a85e78ed9340906d (diff)
downloadprogos-158ea87fba909161a084c29feff29a168725fe4e.tar.gz
progos-158ea87fba909161a084c29feff29a168725fe4e.tar.bz2
progos-158ea87fba909161a084c29feff29a168725fe4e.zip
first priority donation implementation
Diffstat (limited to 'threads/thread.h')
-rw-r--r--threads/thread.h10
1 files changed, 10 insertions, 0 deletions
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
107 unsigned magic; /* Detects stack overflow. */ 107 unsigned magic; /* Detects stack overflow. */
108 108
109 int64_t wakeup_tick; /* absolute tick when to wake up the thread */ 109 int64_t wakeup_tick; /* absolute tick when to wake up the thread */
110
111 int is_donated; /* flag if threads priority has been donated by another thread */
112 int saved_priority; /* saved base priority in case of priority dontation */
113 struct list locks; /* list of locks we currently hold */
110 }; 114 };
111 115
112/* If false (default), use round-robin scheduler. 116/* If false (default), use round-robin scheduler.
@@ -114,6 +118,9 @@ struct thread
114 Controlled by kernel command-line option "-o mlfqs". */ 118 Controlled by kernel command-line option "-o mlfqs". */
115extern bool thread_mlfqs; 119extern bool thread_mlfqs;
116 120
121bool priority_list_cmp_greater (const struct list_elem *a, const struct list_elem *b,
122 void *aux);
123
117void thread_init (void); 124void thread_init (void);
118void thread_start (void); 125void thread_start (void);
119 126
@@ -139,6 +146,9 @@ void thread_foreach (thread_action_func *, void *);
139 146
140int thread_get_priority (void); 147int thread_get_priority (void);
141void thread_set_priority (int); 148void thread_set_priority (int);
149void thread_other_set_priority (struct thread *t, int new_priority);
150void thread_donate_priority (struct thread *donator, struct thread *donee);
151void thread_donation_pass_back (void);
142 152
143int thread_get_nice (void); 153int thread_get_nice (void);
144void thread_set_nice (int); 154void thread_set_nice (int);