This commit is contained in:
Eggert Jung
2025-07-08 02:40:29 +02:00
parent 9ffd22e941
commit cc412f4902
6 changed files with 20 additions and 22 deletions

View File

@@ -27,6 +27,7 @@ void Dispatcher::go(Thread *first) {
}
void Dispatcher::dispatch(Thread *next) {
//lifePointer[Core::getID()] = next;
lifePointer[Core::getID()]->resume(next);
Thread* tmp = lifePointer[Core::getID()];
lifePointer[Core::getID()] = next;
tmp->resume(next);
}

View File

@@ -18,11 +18,10 @@ Thread::Thread(void* tos) {
#include "../thread/scheduler.h"
void Thread::resume(Thread* next) {
Guarded g = Guard::enter();
Context *from = &g.vault().sch.active()->context;
Context *from = &this->context;
Context *to = &next->context;
g.vault().sch.dispatcher.lifePointer[Core::getID()] = next;
//g.vault().sch.dispatcher.lifePointer[Core::getID()] = next;
DBG << "from: " << hex << from << endl;
DBG << "to : " << hex << to << endl << flush;
context_switch(to, from);