[kernel] Make scheduler run queue's prev be an id, not a pointer

This would lead to errors in GDB's j6threads when the previous thread
had already exited.
This commit is contained in:
Justin C. Miller
2023-03-16 19:37:49 -07:00
parent 9fa588566f
commit 201e7191ef
2 changed files with 9 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ scheduler *scheduler::s_instance = nullptr;
struct run_queue
{
tcb_node *current = nullptr;
tcb_node *prev = nullptr;
uint64_t prev = 0;
tcb_list ready[scheduler::num_priorities];
tcb_list blocked;
@@ -310,7 +310,7 @@ scheduler::schedule()
return;
}
queue.prev = queue.current;
queue.prev = queue.current->thread->obj_id();
thread *next_thread = next->thread;
cpu.thread = next_thread;