projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
637d20e
)
Adjust rules for the interrupt level during scheduling.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 29 Aug 2004 07:09:17 +0000
(07:09 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 29 Aug 2004 07:09:17 +0000
(07:09 +0000)
src/threads/thread.c
patch
|
blob
|
history
diff --git
a/src/threads/thread.c
b/src/threads/thread.c
index dd98be0d2bbf846b851c86346c63c884a9191ccd..5e8a32911bfadb80ebf79e30e294d4222d425edb 100644
(file)
--- a/
src/threads/thread.c
+++ b/
src/threads/thread.c
@@
-189,17
+189,17
@@
schedule_tail (struct thread *prev)
{
struct thread *cur = thread_current ();
{
struct thread *cur = thread_current ();
+ ASSERT (intr_get_level () == IF_OFF);
+
#ifdef USERPROG
addrspace_activate (&cur->addrspace);
#endif
if (prev != NULL && prev->status == THREAD_DYING)
thread_destroy (prev);
#ifdef USERPROG
addrspace_activate (&cur->addrspace);
#endif
if (prev != NULL && prev->status == THREAD_DYING)
thread_destroy (prev);
-
- intr_enable ();
}
}
-void
+
static
void
thread_schedule (void)
{
struct thread *cur, *next, *prev;
thread_schedule (void)
{
struct thread *cur, *next, *prev;
@@
-228,11
+228,14
@@
thread_schedule (void)
void
thread_yield (void)
{
void
thread_yield (void)
{
+ enum if_level old_level;
+
ASSERT (!intr_context ());
ASSERT (!intr_context ());
- intr_disable ();
+
old_level =
intr_disable ();
thread_ready (thread_current ());
thread_schedule ();
thread_ready (thread_current ());
thread_schedule ();
+ intr_set_level (old_level);
}
void
}
void