
#include "idle.h"

Idle::Idle()
{
}

Idle::~Idle()
{
}

int Idle::run_task()
{
	IdleTask *task;
	if (idle_queue.size() == 0)
		return idle_queue.size();
	task = idle_queue.front();
	idle_queue.pop_front();
	task->run_task();
	delete task;
	return idle_queue.size();
}

int Idle::queue_task(IdleTask *task, bool front)
{
	if (front == true)
		idle_queue.push_front(task);
	else
		idle_queue.push_back(task);
	return idle_queue.size();
}
