6 void Scheduler::add_thread(Thread *t)
8 DEBUG("thread %d\n", t->get_id());
9 readyList.push_back(t);
12 void Scheduler::remove_thread(Thread *t)
20 Thread * Scheduler::next_thread(void)
22 Thread *t = model->schedule_next_thread();
27 } else if (readyList.empty()) {
30 t = readyList.front();
32 readyList.pop_front();
40 Thread * Scheduler::get_current_thread(void)
45 void Scheduler::print()
48 DEBUG("Current thread: %d\n", current->get_id());
50 DEBUG("No current thread\n");
51 DEBUG("Num. threads in ready list: %zu\n", readyList.size());
53 std::list<Thread *, MyAlloc< Thread * > >::iterator it;
54 for (it = readyList.begin(); it != readyList.end(); it++)
55 DEBUG("In ready list: thread %d\n", (*it)->get_id());