This commit is contained in:
Simon
2025-07-08 01:57:43 +02:00
parent 9ffd22e941
commit c38000e503
2 changed files with 13 additions and 7 deletions

View File

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

View File

@@ -18,14 +18,20 @@ 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 *to = &next->context;
Context *from;
Context *to;
g.vault().sch.dispatcher.lifePointer[Core::getID()] = next;
from = &this->context;
to = &next->context;
//dispatcher.lifePointer[Core::getID()] = next;
DBG << "from: " << hex << from << endl;
DBG << "to : " << hex << to << endl << flush;
context_switch(to, from);
}
void Thread::go() {