return t;
}
-/* Does basic initialization of T as a new, blocked thread named
+/* Does basic initialization of T as a blocked thread named
NAME. */
static void
init_thread (struct thread *t, const char *name, int priority)
blocked state is on a semaphore wait list. */
struct thread
{
- /* These members are owned by thread.c. */
+ /* Owned by thread.c. */
tid_t tid; /* Thread identifier. */
enum thread_status status; /* Thread state. */
char name[16]; /* Name (for debugging purposes). */
list_elem elem; /* List element. */
#ifdef USERPROG
- /* These members are owned by userprog/addrspace.c. */
+ /* Owned by userprog/addrspace.c. */
uint32_t *pagedir; /* Page directory. */
#endif
- /* Marker to detect stack overflow. */
- unsigned magic; /* Always set to THREAD_MAGIC. */
+ /* Owned by thread.c */
+ unsigned magic; /* Detects stack overflow. */
};
void thread_init (void);