fix: synchronise threads' SPTs with locks

This commit is contained in:
2024-12-06 17:31:33 +00:00
parent eba8c1ffa8
commit 77fedd6666
4 changed files with 13 additions and 1 deletions

View File

@@ -736,6 +736,8 @@ init_thread (struct thread *t, const char *name, int nice, int priority,
t->recent_cpu = recent_cpu;
t->priority = t->base_priority;
lock_init (&t->pages_lock);
old_level = intr_disable ();
list_push_back (&all_list, &t->allelem);
intr_set_level (old_level);

View File

@@ -136,6 +136,7 @@ struct thread
struct list_elem elem; /* List element. */
struct hash pages; /* Table of open user pages. */
struct lock pages_lock; /* Lock for the supplementary page table. */
/* Memory mapped files for user virtual memory. */
struct hash mmap_files; /* List of memory mapped files. */