+/* Initializes T as a new, blocked thread named NAME. */
+static void
+init_thread (struct thread *t, const char *name)
+{
+ memset (t, 0, sizeof *t);
+ strlcpy (t->name, name, sizeof t->name);
+ t->stack = (uint8_t *) t + PGSIZE;
+ t->status = THREAD_BLOCKED;
+ t->magic = THREAD_MAGIC;
+}
+