6 Scheduler::Scheduler() :
11 void Scheduler::add_thread(Thread *t)
13 DEBUG("thread %d\n", t->get_id());
14 readyList.push_back(t);
17 void Scheduler::remove_thread(Thread *t)
25 Thread * Scheduler::next_thread(void)
27 Thread *t = model->schedule_next_thread();
32 } else if (readyList.empty()) {
35 t = readyList.front();
37 readyList.pop_front();
45 Thread * Scheduler::get_current_thread(void)
50 void Scheduler::print()
53 DEBUG("Current thread: %d\n", current->get_id());
55 DEBUG("No current thread\n");
56 DEBUG("Num. threads in ready list: %zu\n", readyList.size());
58 std::list<Thread *, MyAlloc< Thread * > >::iterator it;
59 for (it = readyList.begin(); it != readyList.end(); it++)
60 DEBUG("In ready list: thread %d\n", (*it)->get_id());