Update thread structure to add a hash table of open files and initialise it, w/ E
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "threads/thread.h"
|
||||
#include <debug.h>
|
||||
#include <hash.h>
|
||||
#include <stddef.h>
|
||||
#include <random.h>
|
||||
#include <stdio.h>
|
||||
@@ -15,6 +16,7 @@
|
||||
#include "threads/vaddr.h"
|
||||
#ifdef USERPROG
|
||||
#include "userprog/process.h"
|
||||
#include "userprog/syscall.h"
|
||||
#endif
|
||||
|
||||
/* Random value for struct thread's `magic' member.
|
||||
@@ -660,6 +662,7 @@ init_thread (struct thread *t, const char *name, int nice, int priority,
|
||||
t->priority = t->base_priority;
|
||||
|
||||
t->exit_status = -1;
|
||||
hash_init (&t->open_files, fd_hash, fd_less, NULL);
|
||||
|
||||
old_level = intr_disable ();
|
||||
list_push_back (&all_list, &t->allelem);
|
||||
|
||||
Reference in New Issue
Block a user