hw: clean-up destruction of processor clients

ref #1088
This commit is contained in:
Martin Stein 2014-03-10 23:21:07 +01:00 committed by Norman Feske
parent 17f17df74b
commit 8818d810a1
4 changed files with 19 additions and 18 deletions

View File

@ -315,9 +315,6 @@ Kernel::Mode_transition_control * Kernel::mtc()
}
Kernel::Processor_client::~Processor_client() { }
Kernel::Cpu_context::Cpu_context()
{
_init(STACK_SIZE);

View File

@ -73,19 +73,19 @@ class Kernel::Double_list_item
Double_list_item * _prev;
Double_list<T> * _list;
protected:
/**
* Return wether this item is managed by a list currently
*/
bool _listed() const { return _list; }
public:
/**
* Constructor
*/
Double_list_item() : _next(0), _prev(0), _list(0) { }
/***************
** Accessors **
***************/
Double_list<T> * list() { return _list; }
};
template <typename T>
@ -217,6 +217,13 @@ class Kernel::Scheduler_item : public Double_list<T>::Item
Priority const _priority;
protected:
/**
* Return wether this item is managed by a scheduler currently
*/
bool _scheduled() const { return Double_list<T>::Item::_listed(); }
public:
/**
@ -370,7 +377,11 @@ class Kernel::Processor_client : public Processor_scheduler::Item
/**
* Destructor
*/
virtual ~Processor_client();
~Processor_client()
{
if (!_scheduled()) { return; }
_unschedule();
}
};
#endif /* _KERNEL__SCHEDULER_H_ */

View File

@ -189,8 +189,6 @@ Thread::Thread(unsigned const priority, char const * const label)
cpu_exception = RESET;
}
Thread::~Thread() { if (Processor_client::list()) { _unschedule(STOPPED); } }
void
Thread::init(Processor * const processor, unsigned const pd_id_arg,

View File

@ -298,11 +298,6 @@ class Kernel::Thread
*/
Thread(unsigned const priority, char const * const label);
/**
* Destructor
*/
~Thread();
/**
* Prepare thread to get scheduled the first time
*