/* Remove this task from the run queue. */ bool task::remove_from_runqueue() { if (!this->running) { return false; } running_tasks.erase(this->runit); this->running = false; return true; }
task::~task() { if (running) { remove_from_runqueue(); } else { paused_tasks.remove_paused_task(this); } all_tasks.erase(taskit); }