From b2e6261ba16955c97f49db49323965eac0a7a6c9 Mon Sep 17 00:00:00 2001 From: guoweikang Date: Tue, 22 Oct 2024 16:29:36 +0800 Subject: [PATCH] fix api comments -------- 1 Recover wait queue from wait list 2 Fix api comments Signed-off-by: guoweikang --- api/arceos_posix_api/build.rs | 4 ++-- modules/axtask/src/wait_queue.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/arceos_posix_api/build.rs b/api/arceos_posix_api/build.rs index 035dd4d516..2f9d803a45 100644 --- a/api/arceos_posix_api/build.rs +++ b/api/arceos_posix_api/build.rs @@ -5,9 +5,9 @@ fn main() { // TODO: generate size and initial content automatically. let (mutex_size, mutex_init) = if cfg!(feature = "multitask") { if cfg!(feature = "smp") { - (3, "{0, 0, 0}") // core::mem::transmute::<_, [usize; 6]>(axsync::Mutex::new(())) + (3, "{0, 0, 0}") // core::mem::transmute::<_, [usize; 3]>(axsync::Mutex::new(())) } else { - (2, "{0, 0}") // core::mem::transmute::<_, [usize; 5]>(axsync::Mutex::new(())) + (2, "{0, 0}") // core::mem::transmute::<_, [usize; 2]>(axsync::Mutex::new(())) } } else { (1, "{0}") diff --git a/modules/axtask/src/wait_queue.rs b/modules/axtask/src/wait_queue.rs index 9252f2cb6a..4f40cb863e 100644 --- a/modules/axtask/src/wait_queue.rs +++ b/modules/axtask/src/wait_queue.rs @@ -57,7 +57,7 @@ impl WaitQueue { } } - /// Cancel events by removing the task from the wait list. + /// Cancel events by removing the task from the wait queue. /// If `from_timer_list` is true, try to remove the task from the timer list. fn cancel_events(&self, waiter: Node, _from_timer_list: bool) { // SAFETY: @@ -83,7 +83,7 @@ impl WaitQueue { } } - /// Blocks the current task and put it into the wait list, until other task + /// Blocks the current task and put it into the wait queue, until other task /// notifies it. pub fn wait(&self) { let waiter = Arc::new(WaitTaskNode::from_current()); @@ -91,7 +91,7 @@ impl WaitQueue { self.cancel_events(waiter, false); } - /// Blocks the current task and put it into the wait list, until the given + /// Blocks the current task and put it into the wait queue, until the given /// `condition` becomes true. /// /// Note that even other tasks notify this task, it will not wake up until @@ -114,7 +114,7 @@ impl WaitQueue { self.cancel_events(waiter, false); } - /// Blocks the current task and put it into the wait list, until other tasks + /// Blocks the current task and put it into the wait queue, until other tasks /// notify it, or the given duration has elapsed. #[cfg(feature = "irq")] pub fn wait_timeout(&self, dur: core::time::Duration) -> bool { @@ -138,7 +138,7 @@ impl WaitQueue { timeout } - /// Blocks the current task and put it into the wait list, until the given + /// Blocks the current task and put it into the wait queue, until the given /// `condition` becomes true, or the given duration has elapsed. /// /// Note that even other tasks notify this task, it will not wake up until @@ -178,7 +178,7 @@ impl WaitQueue { timeout } - /// Wakes up one task in the wait list, usually the first one. + /// Wakes up one task in the wait queue, usually the first one. /// /// If `resched` is true, the current task will be preempted when the /// preemption is enabled. @@ -192,7 +192,7 @@ impl WaitQueue { } } - /// Wakes all tasks in the wait list. + /// Wakes all tasks in the wait queue. /// /// If `resched` is true, the current task will be preempted when the /// preemption is enabled. @@ -202,7 +202,7 @@ impl WaitQueue { } } - /// Wake up the given task in the wait list. + /// Wake up the given task in the wait queue. /// /// If `resched` is true, the current task will be preempted when the /// preemption is enabled.