projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fa3c961
)
Rename run_queue to ready_list.
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 9 Sep 2004 22:43:28 +0000
(22:43 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 9 Sep 2004 22:43:28 +0000
(22:43 +0000)
src/threads/thread.c
patch
|
blob
|
history
diff --git
a/src/threads/thread.c
b/src/threads/thread.c
index 85f107d19ff01e988c9eaa3394522c56afe753ef..ea3562fd39367387c5b272bc2ebabd98e64c0b9b 100644
(file)
--- 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. */
/* List of processes in THREAD_READY state, that is, processes
that are ready to run but not actually running. */
-static struct list r
un_queue
;
+static struct list r
eady_list
;
/* Idle thread. */
static struct thread *idle_thread; /* Thread. */
/* Idle thread. */
static struct thread *idle_thread; /* Thread. */
@@
-67,7
+67,7
@@
thread_init (void)
t->status = THREAD_RUNNING;
/* Initialize run queue. */
t->status = THREAD_RUNNING;
/* Initialize run queue. */
- list_init (&r
un_queue
);
+ list_init (&r
eady_list
);
}
/* Starts preemptive thread scheduling by enabling interrupts.
}
/* 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)
{
old_level = intr_disable ();
if (t->status == THREAD_BLOCKED)
{
- list_push_back (&r
un_queue
, &t->elem);
+ list_push_back (&r
eady_list
, &t->elem);
t->status = THREAD_READY;
}
intr_set_level (old_level);
t->status = THREAD_READY;
}
intr_set_level (old_level);
@@
-241,7
+241,7
@@
thread_yield (void)
ASSERT (!intr_context ());
old_level = intr_disable ();
ASSERT (!intr_context ());
old_level = intr_disable ();
- list_push_back (&r
un_queue
, &cur->elem);
+ list_push_back (&r
eady_list
, &cur->elem);
cur->status = THREAD_READY;
schedule ();
intr_set_level (old_level);
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)
{
static struct thread *
next_thread_to_run (void)
{
- if (list_empty (&r
un_queue
))
+ if (list_empty (&r
eady_list
))
return idle_thread;
else
return idle_thread;
else
- return list_entry (list_pop_front (&r
un_queue
), struct thread, elem);
+ return list_entry (list_pop_front (&r
eady_list
), struct thread, elem);
}
/* Destroys T, which must be in the dying state and must not be
}
/* Destroys T, which must be in the dying state and must not be