+
+/* Invoke function 'func' on all threads, passing along 'aux'.
+ This function must be called with interrupts off. */
+void
+thread_foreach (thread_action_func *func, void *aux)
+{
+ struct list_elem *e;
+
+ ASSERT (intr_get_level () == INTR_OFF);
+
+ for (e = list_begin (&all_list); e != list_end (&all_list);
+ e = list_next (e))
+ {
+ struct thread *t = list_entry (e, struct thread, allelem);
+ func (t, aux);
+ }
+}
+
+/* Sets the current thread's priority to NEW_PRIORITY. */
+void
+thread_set_priority (int new_priority)
+{
+ thread_current ()->priority = new_priority;
+}
+
+/* Returns the current thread's priority. */
+int
+thread_get_priority (void)
+{
+ return thread_current ()->priority;
+}
+
+/* Sets the current thread's nice value to NICE. */
+void
+thread_set_nice (int nice UNUSED)
+{
+ /* Not yet implemented. */
+}
+
+/* Returns the current thread's nice value. */
+int
+thread_get_nice (void)
+{
+ /* Not yet implemented. */
+ return 0;
+}
+
+/* Returns 100 times the system load average. */
+int
+thread_get_load_avg (void)
+{
+ /* Not yet implemented. */
+ return 0;
+}
+
+/* Returns 100 times the current thread's recent_cpu value. */
+int
+thread_get_recent_cpu (void)
+{
+ /* Not yet implemented. */
+ return 0;
+}