Merge branch 'task2/thread-init-bug-fix' into 'master'
Fix Bug in fd_counter initialisation when USERPROG is not defined See merge request lab2425_autumn/pintos_22!49
This commit is contained in:
@@ -254,7 +254,10 @@ thread_create (const char *name, int priority,
|
|||||||
tid = t->tid = allocate_tid ();
|
tid = t->tid = allocate_tid ();
|
||||||
init_process_result (t);
|
init_process_result (t);
|
||||||
|
|
||||||
#ifdef USERPROG
|
#ifdef USERPROG
|
||||||
|
/* Initialize the thread's file descriptor table. */
|
||||||
|
t->fd_counter = MINIMUM_USER_FD;
|
||||||
|
|
||||||
if (!hash_init (&t->open_files, fd_hash, fd_less, NULL)
|
if (!hash_init (&t->open_files, fd_hash, fd_less, NULL)
|
||||||
|| !hash_init (&t->child_results, process_result_hash,
|
|| !hash_init (&t->child_results, process_result_hash,
|
||||||
process_result_less, t))
|
process_result_less, t))
|
||||||
@@ -704,7 +707,6 @@ init_thread (struct thread *t, const char *name, int nice, int priority,
|
|||||||
t->recent_cpu = recent_cpu;
|
t->recent_cpu = recent_cpu;
|
||||||
t->priority = t->base_priority;
|
t->priority = t->base_priority;
|
||||||
|
|
||||||
t->fd_counter = MINIMUM_USER_FD;
|
|
||||||
t->exit_status = -1;
|
t->exit_status = -1;
|
||||||
|
|
||||||
old_level = intr_disable ();
|
old_level = intr_disable ();
|
||||||
|
|||||||
Reference in New Issue
Block a user