Use a single exit_status instead of two

This commit is contained in:
2024-11-15 17:20:51 +00:00
parent e76712d3fd
commit 8567434231
4 changed files with 12 additions and 21 deletions

View File

@@ -673,7 +673,7 @@ init_process_result (struct thread *t)
{
struct process_result *result = malloc (sizeof (struct process_result));
result->tid = t->tid;
result->exit_status = t->exit_status;
result->exit_status = -1;
lock_init (&result->lock);
sema_init (&result->sema, 0);
t->result = result;
@@ -707,8 +707,6 @@ 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);

View File

@@ -135,8 +135,6 @@ 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. */
uint32_t *pagedir; /* Page directory. */