From 2ecd24df827c1bb4392d19b6747f65368da5c32c Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 20 Feb 2025 17:59:27 +0100 Subject: [PATCH] core: Add some annotations to managed thread variables Some thread variables don't need to be set manually, since they are updated whenever needed by some functions. Add comments to make that clear. --- core/src/thread.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/thread.zig b/core/src/thread.zig index ee88b5b..011c004 100644 --- a/core/src/thread.zig +++ b/core/src/thread.zig @@ -17,12 +17,13 @@ pub const ThreadControlBlock = struct { mapper: ?vmm.MemoryMapper, regs: interrupts.InterruptStackFrame, state: ThreadState, - - ticks: u64, - user_priority: u8, - current_priority: u32, + // Managed by scheduleNewTask(), no need to set manually. + ticks: u64, + // Managed by addThreadToPriorityQueue(), no need to set manually. + current_priority: u32, + // Managed by startSleep(), no need to set manually. sleep_ticks: u64, };