Redo makefiles.
[pintos-anon] / src / threads / thread.h
index a70b48b50cb0305f2147089a0b4db17948e8de46..27c1f041fa8f24f094cd666a3b50d8cd63840c0f 100644 (file)
@@ -2,11 +2,11 @@
 #define HEADER_THREAD_H 1
 
 #include <stdint.h>
-#include "debug.h"
-#include "list.h"
+#include "lib/debug.h"
+#include "lib/list.h"
 
 #ifdef USERPROG
-#include "addrspace.h"
+#include "userprog/addrspace.h"
 #endif
 
 /* States in a thread's life cycle. */
@@ -68,13 +68,19 @@ enum thread_status
    the `magic' member of the running thread's `struct thread' is
    set to THREAD_MAGIC.  Stack overflow will normally change this
    value, triggering the assertion. */
+/* The `elem' member has a dual purpose.  It can be an element in
+   the run queue (thread.c), or it can be an element in a
+   semaphore wait list (synch.c).  It can be used these two ways
+   only because they are mutually exclusive: only a thread in the
+   ready state is on the run queue, whereas only a thread in the
+   blocked state is on a semaphore wait list. */
 struct thread
   {
     /* These members are owned by the thread_*() functions. */
     enum thread_status status;          /* Thread state. */
     char name[16];                      /* Name (for debugging purposes). */
     uint8_t *stack;                     /* Saved stack pointer. */
-    list_elem rq_elem;                  /* Run queue list element. */
+    list_elem elem;                     /* List element. */
 
 #ifdef USERPROG
     /* These members are owned by the addrspace_*() functions. */