main
Simon 4 months ago
parent 9ffd22e941
commit c38000e503

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

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

Loading…
Cancel
Save