Implement initialization of new threads to track donation information, w/ S

This commit is contained in:
Themis Demetriades
2024-10-20 17:11:44 +01:00
parent 8b1e0b9559
commit fcc8cbb71e

View File

@@ -510,9 +510,13 @@ init_thread (struct thread *t, const char *name, int priority)
t->status = THREAD_BLOCKED; t->status = THREAD_BLOCKED;
strlcpy (t->name, name, sizeof t->name); strlcpy (t->name, name, sizeof t->name);
t->stack = (uint8_t *) t + PGSIZE; t->stack = (uint8_t *) t + PGSIZE;
t->priority = priority; t->base_priority = priority;
t->magic = THREAD_MAGIC; t->magic = THREAD_MAGIC;
list_init (&t->donors_list);
t->priority = t->base_priority;
t->waiting_lock = NULL;
old_level = intr_disable (); old_level = intr_disable ();
list_push_back (&all_list, &t->allelem); list_push_back (&all_list, &t->allelem);
intr_set_level (old_level); intr_set_level (old_level);