X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fthreads%2Fthread.h;h=421751be943f90bd7ad080b3dae9aecdb593d095;hb=3625c2e6aba3b282f91282492c4b3fba324816c1;hp=a70b48b50cb0305f2147089a0b4db17948e8de46;hpb=b413e78bacc4a0331191e581cd060281ba47c54a;p=pintos-anon diff --git a/src/threads/thread.h b/src/threads/thread.h index a70b48b..421751b 100644 --- a/src/threads/thread.h +++ b/src/threads/thread.h @@ -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. */