summaryrefslogtreecommitdiffstats
path: root/src/threads/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/threads/thread.c')
-rw-r--r--src/threads/thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/threads/thread.c b/src/threads/thread.c
index 92d1aa8..3112a71 100644
--- a/src/threads/thread.c
+++ b/src/threads/thread.c
@@ -13,6 +13,7 @@
#include "threads/vaddr.h"
#ifdef USERPROG
#include "userprog/process.h"
+#include "threads/malloc.h"
#endif
/* Random value for struct thread's `magic' member.
@@ -435,6 +436,9 @@ init_thread (struct thread *t, const char *name, int priority)
strlcpy (t->name, name, sizeof t->name);
t->stack = (uint8_t *) t + PGSIZE;
t->priority = priority;
+#ifdef USERPROG
+ list_init (&t->children);
+#endif
t->magic = THREAD_MAGIC;
}