6 void Scheduler::add_thread(Thread *t)
8 DEBUG("thread %d\n", t->get_id());
9 readyList.push_back(t);
12 Thread *Scheduler::next_thread(void)
14 Thread *t = model->schedule_next_thread();
22 if (readyList.empty())
25 current = readyList.front();
26 readyList.pop_front();
31 Thread *Scheduler::get_current_thread(void)
36 void Scheduler::print()
39 printf("Current thread: %d\n", current->get_id());
41 printf("No current thread\n");
42 printf("# Threads in ready list: %ld\n", readyList.size());
44 std::list<Thread *>::iterator it;
45 for (it = readyList.begin(); it != readyList.end(); it++)
46 printf("In ready list: thread %d\n", (*it)->get_id());