Implement syscall for file opening and refactor open_files initialisation in thread.c w/ S.
This commit is contained in:
@@ -238,6 +238,7 @@ thread_create (const char *name, int priority,
|
||||
struct thread *parent_thread = thread_current ();
|
||||
init_thread (t, name, parent_thread->nice, priority, parent_thread->recent_cpu);
|
||||
tid = t->tid = allocate_tid ();
|
||||
hash_init (&t->open_files, fd_hash, fd_less, NULL);
|
||||
|
||||
/* Prepare thread for first run by initializing its stack.
|
||||
Do this atomically so intermediate values for the 'stack'
|
||||
@@ -662,7 +663,6 @@ 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