Merge branch 'master' into 'BSD-merged', fixing merge conflicts

# Conflicts:
#   src/threads/thread.c
This commit is contained in:
Dias Alberto, Ethan
2024-10-23 16:30:24 +00:00
4 changed files with 285 additions and 16 deletions

View File

@@ -95,6 +95,15 @@ struct thread
int priority; /* Priority. */
struct list_elem allelem; /* List element for all threads list. */
/* Donation Related */
int base_priority; /* Base priority of the thread. */
struct list donors_list; /* List of threads that have donated
to this thread. */
struct lock *waiting_lock; /* The lock that the current thread is
waiting for. */
struct list_elem donor_elem; /* List element so that thread can be
enlisted in other donors list. */
/* Shared between thread.c and synch.c. */
struct list_elem elem; /* List element. */
@@ -140,12 +149,17 @@ void thread_yield (void);
typedef void thread_action_func (struct thread *t, void *aux);
void thread_foreach (thread_action_func *, void *);
bool priority_more (const struct list_elem *a_, const struct list_elem *b_,
void *aux UNUSED);
int thread_get_priority (void);
void thread_set_priority (int);
void thread_recalculate_priority (void);
int thread_get_nice (void);
void thread_set_nice (int);
int thread_get_recent_cpu (void);
int thread_get_load_avg (void);
void ready_list_reinsert (struct thread *t);
#endif /* threads/thread.h */