Add thread logger, split renderer from PICA

This commit is contained in:
wheremyfoodat 2023-01-01 21:04:34 +02:00
parent 672a893938
commit 9f792c2cf5
5 changed files with 28 additions and 25 deletions

View file

@ -11,7 +11,7 @@ void Kernel::switchThread(int newThreadIndex) {
auto& oldThread = threads[currentThreadIndex];
auto& newThread = threads[newThreadIndex];
newThread.status = ThreadStatus::Running;
printf("Switching from thread %d to %d\n", currentThreadIndex, newThreadIndex);
logThread("Switching from thread %d to %d\n", currentThreadIndex, newThreadIndex);
// Bail early if the new thread is actually the old thread
if (currentThreadIndex == newThreadIndex) [[unlikely]] {
@ -70,8 +70,6 @@ std::optional<int> Kernel::getNextThread() {
if (canThreadRun(t)) {
return index;
}
// TODO: Check timeouts here
}
// No thread was found