hw: destruct scheduling contexts

ref #589
This commit is contained in:
Martin Stein 2013-09-17 11:13:15 +02:00 committed by Norman Feske
parent 52ec56c060
commit a596fa56a6
2 changed files with 15 additions and 0 deletions

View File

@ -138,6 +138,13 @@ class Kernel::Double_list<T>::Item
* Constructor
*/
Item() : _next(0), _prev(0), _list(0) { }
/***************
** Accessors **
***************/
Double_list<T> * list() { return _list; }
};
template <typename T>

View File

@ -72,6 +72,14 @@ class Kernel::Execution_context : public Cpu_scheduler::Item
* Continue execution
*/
virtual void proceed() = 0;
/**
* Destructor
*/
virtual ~Execution_context()
{
if (list()) { cpu_scheduler()->remove(this); }
}
};
class Kernel::Thread