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();
19 } else if (readyList.empty()) {
22 t = readyList.front();
24 readyList.pop_front();
32 Thread *Scheduler::get_current_thread(void)
37 void Scheduler::print()
40 printf("Current thread: %d\n", current->get_id());
42 printf("No current thread\n");
43 printf("Num. threads in ready list: %ld\n", readyList.size());
45 std::list<Thread *>::iterator it;
46 for (it = readyList.begin(); it != readyList.end(); it++)
47 printf("In ready list: thread %d\n", (*it)->get_id());