From cd1b385944eded6f320251c2353ccecd74d1abe9 Mon Sep 17 00:00:00 2001 From: Godmar Back Date: Mon, 8 Sep 2008 01:30:24 +0000 Subject: [PATCH] update after thread_foreach --- solutions/p4.patch | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/solutions/p4.patch b/solutions/p4.patch index a08baa3..d1281ca 100644 --- a/solutions/p4.patch +++ b/solutions/p4.patch @@ -2120,12 +2120,10 @@ 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 (); @@ -2133,14 +2131,7 @@ diff -u src/threads/thread.c~ src/threads/thread.c 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,29 @@ is_thread (struct thread *t) /* Does basic initialization of T as a blocked thread named NAME. */ -- 2.30.2