Cycle through multiple tasks in multiple processes
This commit is contained in:
parent
7a3b4d2d42
commit
d3024211a7
6 changed files with 56 additions and 12 deletions
|
|
@ -8,9 +8,8 @@ namespace {
|
|||
|
||||
extern "C" void thread_init() {
|
||||
asm("sti");
|
||||
dbgln("New Thread!");
|
||||
sched::Yield();
|
||||
panic("End of thread.");
|
||||
sched::CurrentThread().Init();
|
||||
panic("Reached end of thread.");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
@ -32,3 +31,10 @@ Thread::Thread(Process* proc, uint64_t tid) : process_(proc), id_(tid) {
|
|||
}
|
||||
|
||||
uint64_t Thread::pid() { return process_->id(); }
|
||||
|
||||
void Thread::Init() {
|
||||
while (true) {
|
||||
dbgln("[%u.%u]", pid(), id_);
|
||||
sched::Yield();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue