From fb268cdef0493b508eaeb44997e29a6da4421b41 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Thu, 17 Oct 2024 06:47:58 +0100 Subject: [PATCH] Update thread make priority_more public --- src/threads/thread.c | 5 +---- src/threads/thread.h | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/threads/thread.c b/src/threads/thread.c index 52d8577..67d08d1 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -70,9 +70,6 @@ static void *alloc_frame (struct thread *, size_t size); static void schedule (void); void thread_schedule_tail (struct thread *prev); static tid_t allocate_tid (void); -static bool priority_more (const struct list_elem *a_, - const struct list_elem *b_, - void *aux UNUSED); /* Initializes the threading system by transforming the code that's currently running into a thread. This can't work in @@ -366,7 +363,7 @@ thread_foreach (thread_action_func *func, void *aux) /* Function that compares the two threads associated with the provided list_elem structures. Returns true if the thread associated with a_ has a higher priority than that of b_. */ -static bool +bool priority_more (const struct list_elem *a_, const struct list_elem *b_, void *aux UNUSED) { diff --git a/src/threads/thread.h b/src/threads/thread.h index f36d7ac..1cde088 100644 --- a/src/threads/thread.h +++ b/src/threads/thread.h @@ -131,6 +131,8 @@ 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);