projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fa7a9e
)
Make thread_unblock() on a thread that isn't blocked an error.
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 16 Sep 2004 21:11:40 +0000
(21:11 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 16 Sep 2004 21:11:40 +0000
(21:11 +0000)
src/threads/thread.c
patch
|
blob
|
history
diff --git
a/src/threads/thread.c
b/src/threads/thread.c
index 5400f78de4d5f960c593d9bce1c86cc6603a64c6..90a4dcd6456f77423a781265737ed823ffbf3dc7 100644
(file)
--- a/
src/threads/thread.c
+++ b/
src/threads/thread.c
@@
-183,7
+183,7
@@
thread_execute (const char *filename)
#endif
/* Transitions a blocked thread T from its current state to the
#endif
/* Transitions a blocked thread T from its current state to the
- ready-to-run state.
If T is not blocked, there is no effect
.
+ ready-to-run state.
This is an error if T is not blocked
.
(Use thread_yield() to make the running thread ready.) */
void
thread_unblock (struct thread *t)
(Use thread_yield() to make the running thread ready.) */
void
thread_unblock (struct thread *t)
@@
-193,11
+193,9
@@
thread_unblock (struct thread *t)
ASSERT (is_thread (t));
old_level = intr_disable ();
ASSERT (is_thread (t));
old_level = intr_disable ();
- if (t->status == THREAD_BLOCKED)
- {
- list_push_back (&ready_list, &t->elem);
- t->status = THREAD_READY;
- }
+ ASSERT (t->status == THREAD_BLOCKED);
+ list_push_back (&ready_list, &t->elem);
+ t->status = THREAD_READY;
intr_set_level (old_level);
}
intr_set_level (old_level);
}