From 55ccc812e6ec7f639391be8239fb5de9a47b25a0 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Mon, 18 May 2020 09:11:41 -0400 Subject: [PATCH] Add comments. --- risc_v/src/sched.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/risc_v/src/sched.rs b/risc_v/src/sched.rs index 685a754..272ea8c 100755 --- a/risc_v/src/sched.rs +++ b/risc_v/src/sched.rs @@ -9,6 +9,9 @@ use crate::cpu::get_mtime; pub fn schedule() -> usize { let mut frame_addr: usize = 0x1111; unsafe { + // If we can't get the lock, then usually this means a kernel + // process has the lock. So, we return 0. This has a special + // meaning to whomever calls the scheduler to say "nobody else got scheduled" if PROCESS_LIST_MUTEX.try_lock() == false { return 0; }