more or less works (with kill)

This commit is contained in:
Eggert Jung
2025-07-08 13:49:52 +02:00
parent cc412f4902
commit fd021c98a7
7 changed files with 33 additions and 7 deletions

View File

@@ -1,6 +1,10 @@
// vim: set noet ts=4 sw=4:
#include "scheduler.h"
#include "../arch/lapic.h"
#include "dispatcher.h"
#include "../interrupt/guard.h"
#include "../debug/output.h"
Queue<Thread> readyList = Queue<Thread>();
@@ -39,6 +43,17 @@ void Scheduler::exit() {
void Scheduler::kill(Thread* that) {
readyList.remove(that);
that->kill_flag = true;
DBG << "kill..." << flush;
for(uint8_t i=0;i<Core::MAX; i++)
if(dispatcher.lifePointer[i] == that){
LAPIC::IPI::send(i, Core::Interrupt::Vector::ASSASSIN);
DBG << "found thread on Core << dec << static_cast<int>(i) << "! killing...\n" << flush;
return;
}
DBG << "not found\n" << flush;
}
bool Scheduler::isActive(const Thread* thread, unsigned int* cpu) {