From: Godmar Back Date: Thu, 28 Aug 2008 04:25:48 +0000 (+0000) Subject: update - made to pass again after thread_foreach X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=860b412432fd3b967d777517e82badaf4bf8238e;p=pintos-anon update - made to pass again after thread_foreach --- diff --git a/solutions/p3.patch b/solutions/p3.patch index 5e54dd6..556be83 100644 --- a/solutions/p3.patch +++ b/solutions/p3.patch @@ -174,28 +174,18 @@ diff -u src/threads/thread.c~ src/threads/thread.c /* Stack frame for kernel_thread(). */ kf = alloc_frame (t, sizeof *kf); -@@ -253,16 +254,19 @@ thread_tid (void) +@@ -288,10 +289,11 @@ thread_tid (void) void thread_exit (void) { -+ struct thread *t = thread_current (); -+ ASSERT (!intr_context ()); + syscall_exit (); #ifdef USERPROG process_exit (); #endif -- -+ - /* Just set our status to dying and schedule another process. - We will be destroyed during the call to schedule_tail(). */ - intr_disable (); -- thread_current ()->status = THREAD_DYING; -+ t->status = THREAD_DYING; - schedule (); - NOT_REACHED (); - } + + /* Remove thread from all threads list, set our status to dying, @@ -406,17 +410,28 @@ is_thread (struct thread *t) /* Does basic initialization of T as a blocked thread named NAME. */