Rename printk() to printf().
[pintos-anon] / src / threads / thread.c
index 52f0f8d4fc73d8f65818163aaca9c7229cf8e97e..85f107d19ff01e988c9eaa3394522c56afe753ef 100644 (file)
@@ -1,15 +1,15 @@
-#include "thread.h"
+#include "threads/thread.h"
+#include <debug.h>
 #include <stddef.h>
-#include "debug.h"
-#include "interrupt.h"
-#include "intr-stubs.h"
-#include "lib.h"
-#include "mmu.h"
-#include "palloc.h"
-#include "random.h"
-#include "switch.h"
+#include <random.h>
+#include <string.h>
+#include "threads/interrupt.h"
+#include "threads/intr-stubs.h"
+#include "threads/mmu.h"
+#include "threads/palloc.h"
+#include "threads/switch.h"
 #ifdef USERPROG
-#include "gdt.h"
+#include "userprog/gdt.h"
 #endif
 
 /* Value for struct thread's `magic' member.
@@ -182,7 +182,7 @@ thread_unblock (struct thread *t)
   old_level = intr_disable ();
   if (t->status == THREAD_BLOCKED) 
     {
-      list_push_back (&run_queue, &t->rq_elem);
+      list_push_back (&run_queue, &t->elem);
       t->status = THREAD_READY;
     }
   intr_set_level (old_level);
@@ -241,7 +241,7 @@ thread_yield (void)
   ASSERT (!intr_context ());
 
   old_level = intr_disable ();
-  list_push_back (&run_queue, &cur->rq_elem);
+  list_push_back (&run_queue, &cur->elem);
   cur->status = THREAD_READY;
   schedule ();
   intr_set_level (old_level);
@@ -364,7 +364,7 @@ next_thread_to_run (void)
   if (list_empty (&run_queue))
     return idle_thread;
   else
-    return list_entry (list_pop_front (&run_queue), struct thread, rq_elem);
+    return list_entry (list_pop_front (&run_queue), struct thread, elem);
 }
 
 /* Destroys T, which must be in the dying state and must not be