mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
hw: always panic on removal of scheduler head
Because of helping, it is possible that a core thread that wants to destroy another thread at the kernel is using the scheduling context of the thread that shall be destroyed at this point in time. When building without GENODE_RELEASE defined, this always triggers an assertion in the kernel. But when building with GENODE_RELEASE defined, this might silently lead to kernel-memory corruption. This commit eliminates the latter case. Should be reverted as soon as the scheduler is able to remove its head. Ref #1537
This commit is contained in:
parent
28804e2bfb
commit
8a99c08ae4
@ -180,7 +180,18 @@ void Cpu_scheduler::yield() { _head_yields = 1; }
|
||||
|
||||
void Cpu_scheduler::remove(Share * const s)
|
||||
{
|
||||
assert(s != _idle && s != _head);
|
||||
assert(s != _idle);
|
||||
|
||||
/*
|
||||
* FIXME
|
||||
* Thanks to helping, this can happen and shall not be treated as bad
|
||||
* behavior. But by now, we have no stable solution for it.
|
||||
*
|
||||
*/
|
||||
if (s == _head) {
|
||||
PERR("Removing the head of the CPU scheduler isn't supported by now.");
|
||||
while (1) ;
|
||||
}
|
||||
if (s->_ready) { _fills.remove(s); }
|
||||
if (!s->_quota) { return; }
|
||||
if (s->_ready) { _rcl[s->_prio].remove(s); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user