diff --git a/src/threads/thread.c b/src/threads/thread.c index 037f309..1877dff 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -238,7 +238,10 @@ 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); + + #ifdef USERPROG + hash_init (&t->open_files, fd_hash, fd_less, NULL); + #endif /* Prepare thread for first run by initializing its stack. Do this atomically so intermediate values for the 'stack'