Revert "Adjust p2.patch and p3.patch so that threads kernel still builds"
[pintos-anon] / solutions / p2.patch
index 42296f4711a41a7bcfb00dfc0cc5f24ec49c1b83..5b3646734279ff500bfa36983947062b20594ca3 100644 (file)
@@ -1,5 +1,5 @@
 diff --git a/src/threads/thread.c b/src/threads/thread.c
-index 86614f5..7c19894 100644
+index 86614f5..9fa7f1c 100644
 --- a/src/threads/thread.c
 +++ b/src/threads/thread.c
 @@ -15,6 +15,7 @@
@@ -10,14 +10,16 @@ index 86614f5..7c19894 100644
  #endif
  
  /* Random value for struct thread's `magic' member.
-@@ -350,6 +351,7 @@ thread_exit (void)
-
+@@ -351,7 +352,8 @@ thread_exit (void)
  #ifdef USERPROG
    process_exit ();
-+  syscall_exit ();
  #endif
-
+-
++  syscall_exit ();
++  
    /* Remove thread from all threads list, set our status to dying,
+      and schedule another process.  That process will destroy us
+      when it calls thread_schedule_tail(). */
 @@ -608,6 +610,10 @@ init_thread (struct thread *t, const char *name, int priority)
    strlcpy (t->name, name, sizeof t->name);
    t->stack = (uint8_t *) t + PGSIZE;