X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fthread.h;h=c4520580fcbca7b20bc1596eeb7bcc538db06d10;hb=476eef1e2009a13352732b0d41b37c426050eaac;hp=a5308aac3682802064f4910c945b2551cddece7a;hpb=102ba3ee754e0cdc61ad66a3322e92e3d15fe171;p=pintos-anon diff --git a/src/threads/thread.h b/src/threads/thread.h index a5308aa..c452058 100644 --- a/src/threads/thread.h +++ b/src/threads/thread.h @@ -11,7 +11,6 @@ enum thread_status { - THREAD_INITIALIZING, THREAD_RUNNING, THREAD_READY, THREAD_BLOCKED, @@ -20,13 +19,19 @@ enum thread_status struct thread { - enum thread_status status; - char name[16]; - uint8_t *stack; - list_elem rq_elem; + /* 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. */ + #ifdef USERPROG - struct addrspace addrspace; + /* These members are owned by the addrspace_*() functions. */ + uint32_t *pagedir; /* Page directory. */ #endif + + /* Marker to detect stack overflow. */ + unsigned magic; /* Always set to THREAD_MAGIC. */ }; void thread_init (void); @@ -37,8 +42,8 @@ struct thread *thread_create (const char *name, void (*) (void *aux), void *); bool thread_execute (const char *filename); #endif -void thread_destroy (struct thread *); -void thread_ready (struct thread *); +void thread_wake (struct thread *); +const char *thread_name (struct thread *); struct thread *thread_current (void); void thread_exit (void) NO_RETURN;