From c38000e5035a2ad61b78f51f1617e837807542b2 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 8 Jul 2025 01:57:43 +0200 Subject: [PATCH] foooo --- thread/dispatcher.cc | 2 +- thread/thread.cc | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/thread/dispatcher.cc b/thread/dispatcher.cc index 085d2ad..7ed5862 100644 --- a/thread/dispatcher.cc +++ b/thread/dispatcher.cc @@ -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); } diff --git a/thread/thread.cc b/thread/thread.cc index 7d487e1..c7f7fcd 100644 --- a/thread/thread.cc +++ b/thread/thread.cc @@ -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; - DBG << "from: " << hex << from << endl; - DBG << "to : " << hex << to << endl << flush; + + 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() {