void DefaultScheduler::add_thread(struct thread *t)
{
DEBUG("thread %d\n", t->id);
- queue.push_back(t);
+ queue.push(t);
}
struct thread *DefaultScheduler::next_thread(void)
return NULL;
current = queue.front();
- queue.pop_front();
+ queue.pop();
return current;
}
#ifndef __SCHEDULE_H__
#define __SCHEDULE_H__
-#include <list>
+#include <queue>
#include "libthreads.h"
#include "model.h"
struct thread * next_thread(void);
struct thread * get_current_thread(void);
private:
- std::list<struct thread *> queue;
+ std::queue<struct thread *> queue;
struct thread *current;
};