1 #ifndef HEADER_THREAD_H
2 #define HEADER_THREAD_H 1
22 /* These members are owned by the thread_*() functions. */
23 enum thread_status status; /* Thread state. */
24 char name[16]; /* Name (for debugging purposes). */
25 uint8_t *stack; /* Saved stack pointer. */
26 list_elem rq_elem; /* Run queue list element. */
29 /* These members are owned by the addrspace_*() functions. */
30 uint32_t *pagedir; /* Page directory. */
33 /* Marker to detect stack overflow. */
34 unsigned magic; /* Always set to THREAD_MAGIC. */
37 void thread_init (void);
38 void thread_start (void) NO_RETURN;
40 typedef void thread_func (void *aux);
41 struct thread *thread_create (const char *name, thread_func *, void *);
43 bool thread_execute (const char *filename);
46 void thread_wake (struct thread *);
47 const char *thread_name (struct thread *);
49 struct thread *thread_current (void);
50 void thread_exit (void) NO_RETURN;
51 void thread_yield (void);
52 void thread_sleep (void);