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