projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
schedule: refactor next_thread() for better debug printing
[model-checker.git]
/
schedule.cc
diff --git
a/schedule.cc
b/schedule.cc
index 2498347c44cc6e2cb6cbb870a829465c318504db..4d1cb126579584942c67e32160c8f5e33669472b 100644
(file)
--- a/
schedule.cc
+++ b/
schedule.cc
@@
-13,19
+13,19
@@
Thread *Scheduler::next_thread(void)
{
Thread *t = model->schedule_next_thread();
{
Thread *t = model->schedule_next_thread();
- print();
-
if (t != NULL) {
readyList.remove(t);
if (t != NULL) {
readyList.remove(t);
- return t;
+ } else if (readyList.empty()) {
+ t = NULL;
+ } else {
+ t = readyList.front();
+ current = t;
+ readyList.pop_front();
}
}
- if (readyList.empty())
- return NULL;
- current = readyList.front();
- readyList.pop_front();
+ print();
- return
curren
t;
+ return t;
}
Thread *Scheduler::get_current_thread(void)
}
Thread *Scheduler::get_current_thread(void)