From ecff299b28d7a5a16f623e33f96d94a1d06f2ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Thu, 9 Mar 2023 14:03:35 +0100 Subject: [PATCH] added comments to macros --- src/kernel/thread.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kernel/thread.rs b/src/kernel/thread.rs index 298df68..31029f8 100644 --- a/src/kernel/thread.rs +++ b/src/kernel/thread.rs @@ -106,6 +106,7 @@ mod test { use super::{Thread, ThreadContext, NUM_INT_REGS, NUM_FP_REGS, ObjectType}; const DEFAULT_THREAD_NAME: &str = "test_thread"; + /// Polymorphic macro to get thread without passing a name by default macro_rules! get_new_thread { () => { Thread::new(DEFAULT_THREAD_NAME) }; ($a:literal) => { @@ -113,6 +114,9 @@ mod test { }; } + /// This macro allows for getting a Thread for which we've ensured proper initial state + /// in case a commit further down the line changes the initial state of threads generated + /// from Thread::new macro_rules! expected_initial_state { () => { expected_initial_state!(DEFAULT_THREAD_NAME) }; ($a:expr) => { {