1 #ifndef HEADER_THREAD_H
2 #define HEADER_THREAD_H 1
22 enum thread_status status; /* Thread state. */
23 char name[16]; /* Name (for debugging purposes). */
24 uint8_t *stack; /* Saved stack pointer. */
25 list_elem rq_elem; /* Run queue list element. */
27 struct addrspace addrspace; /* Userland address space. */
29 unsigned magic; /* Always set to THREAD_MAGIC. */
32 void thread_init (void);
33 void thread_start (void) NO_RETURN;
35 struct thread *thread_create (const char *name, void (*) (void *aux), void *);
37 bool thread_execute (const char *filename);
40 void thread_wake (struct thread *);
41 const char *thread_name (struct thread *);
43 struct thread *thread_current (void);
44 void thread_exit (void) NO_RETURN;
45 void thread_yield (void);
46 void thread_sleep (void);