progress on scheduler/dispatcher implementation
parent
944d4991cb
commit
5b664840d8
@ -1,17 +1,30 @@
|
||||
// vim: set noet ts=4 sw=4:
|
||||
|
||||
#include "dispatcher.h"
|
||||
#include "core.h"
|
||||
|
||||
Dispatcher::Dispatcher() {}
|
||||
Dispatcher::Dispatcher() {
|
||||
}
|
||||
|
||||
Thread *Dispatcher::active() { return nullptr; }
|
||||
Thread *Dispatcher::active() {
|
||||
return lifePointer[Core::getID()];
|
||||
}
|
||||
|
||||
bool Dispatcher::isActive(const Thread *thread, unsigned *cpu) {
|
||||
(void)thread;
|
||||
(void)cpu;
|
||||
for(uint8_t i=0; i<Core::MAX; i++){
|
||||
if(thread == lifePointer[i]){
|
||||
*cpu = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cpu = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Dispatcher::go(Thread *first) { (void)first; }
|
||||
void Dispatcher::go(Thread *first) {
|
||||
first->go();
|
||||
}
|
||||
|
||||
void Dispatcher::dispatch(Thread *next) { (void)next; }
|
||||
void Dispatcher::dispatch(Thread *next) {
|
||||
lifePointer[Core::getID()]->resume(next);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue