thread_exit (void)
{
+ struct thread *t = thread_current ();
-+ list_elem *e, *next;
++ struct list_elem *e, *next;
+
ASSERT (!intr_context ());
+thread_join (tid_t child_tid)
+{
+ struct thread *cur = thread_current ();
-+ list_elem *e;
++ struct list_elem *e;
+
+ for (e = list_begin (&cur->children); e != list_end (&cur->children); )
+ {
+ struct latch ready_to_die; /* Release when thread about to die. */
+ struct semaphore can_die; /* Up when thread allowed to die. */
+ struct list children; /* List of child threads. */
-+ list_elem children_elem; /* Element of `children' list. */
++ struct list_elem children_elem; /* Element of `children' list. */
+ int exit_code; /* Return status. */
+
/* Shared between thread.c and synch.c. */
- list_elem elem; /* List element. */
+ struct list_elem elem; /* List element. */
#ifdef USERPROG
/* Owned by userprog/process.c. */
+/* A file descriptor, for binding a file handle to a file. */
+struct file_descriptor
+ {
-+ list_elem elem; /* List element. */
-+ struct file *file; /* File. */
-+ int handle; /* File handle. */
++ struct list_elem elem; /* List element. */
++ struct file *file; /* File. */
++ int handle; /* File handle. */
+ };
+
+/* Open system call. */
+lookup_fd (int handle)
+{
+ struct thread *cur = thread_current ();
-+ list_elem *e;
++ struct list_elem *e;
+
+ for (e = list_begin (&cur->fds); e != list_end (&cur->fds);
+ e = list_next (e))
+syscall_exit (void)
+{
+ struct thread *cur = thread_current ();
-+ list_elem *e, *next;
++ struct list_elem *e, *next;
+
+ for (e = list_begin (&cur->fds); e != list_end (&cur->fds); e = next)
+ {