From 2dccd87a76992159c2540604d5f8bd4ec8527982 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Tue, 5 Nov 2024 22:38:09 +0000 Subject: [PATCH] Update thread to add exit_status, intialised to -1, into the thread structure, w/ E --- src/threads/thread.c | 2 ++ src/threads/thread.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/threads/thread.c b/src/threads/thread.c index 7102ad2..457f7b9 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -659,6 +659,8 @@ init_thread (struct thread *t, const char *name, int nice, int priority, t->recent_cpu = recent_cpu; t->priority = t->base_priority; + t->exit_status = -1; + old_level = intr_disable (); list_push_back (&all_list, &t->allelem); intr_set_level (old_level); diff --git a/src/threads/thread.h b/src/threads/thread.h index c7cc364..1c05030 100644 --- a/src/threads/thread.h +++ b/src/threads/thread.h @@ -111,6 +111,7 @@ struct thread /* Shared between thread.c and synch.c. */ struct list_elem elem; /* List element. */ + int exit_status; /* Exit Status: 0 = successful exit. */ #ifdef USERPROG /* Owned by userprog/process.c. */