From df1ff3bff91352072525b5711841e6bccbd731aa Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 9 Sep 2004 22:43:28 +0000 Subject: [PATCH] Rename run_queue to ready_list. --- src/threads/thread.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/threads/thread.c b/src/threads/thread.c index 85f107d..ea3562f 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -19,7 +19,7 @@ /* List of processes in THREAD_READY state, that is, processes that are ready to run but not actually running. */ -static struct list run_queue; +static struct list ready_list; /* Idle thread. */ static struct thread *idle_thread; /* Thread. */ @@ -67,7 +67,7 @@ thread_init (void) t->status = THREAD_RUNNING; /* Initialize run queue. */ - list_init (&run_queue); + list_init (&ready_list); } /* Starts preemptive thread scheduling by enabling interrupts. @@ -182,7 +182,7 @@ thread_unblock (struct thread *t) old_level = intr_disable (); if (t->status == THREAD_BLOCKED) { - list_push_back (&run_queue, &t->elem); + list_push_back (&ready_list, &t->elem); t->status = THREAD_READY; } intr_set_level (old_level); @@ -241,7 +241,7 @@ thread_yield (void) ASSERT (!intr_context ()); old_level = intr_disable (); - list_push_back (&run_queue, &cur->elem); + list_push_back (&ready_list, &cur->elem); cur->status = THREAD_READY; schedule (); intr_set_level (old_level); @@ -361,10 +361,10 @@ alloc_frame (struct thread *t, size_t size) static struct thread * next_thread_to_run (void) { - if (list_empty (&run_queue)) + if (list_empty (&ready_list)) return idle_thread; else - return list_entry (list_pop_front (&run_queue), struct thread, elem); + return list_entry (list_pop_front (&ready_list), struct thread, elem); } /* Destroys T, which must be in the dying state and must not be -- 2.30.2