This is an automated email from the ASF dual-hosted git repository. ligd pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit f1b355f118a8ed9b5da6bd35920f0c1ed4be48a1 Author: ouyangxiangzhen <[email protected]> AuthorDate: Mon Jan 26 11:23:45 2026 +0800 sched/hrtimer: Update the comments. This commit updated the comments. Signed-off-by: ouyangxiangzhen <[email protected]> --- sched/hrtimer/hrtimer_cancel.c | 4 ++-- sched/hrtimer/hrtimer_process.c | 10 +++++----- sched/hrtimer/hrtimer_start.c | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sched/hrtimer/hrtimer_cancel.c b/sched/hrtimer/hrtimer_cancel.c index d77330c186d..0415511bead 100644 --- a/sched/hrtimer/hrtimer_cancel.c +++ b/sched/hrtimer/hrtimer_cancel.c @@ -83,7 +83,7 @@ int hrtimer_cancel(FAR hrtimer_t *hrtimer) DEBUGASSERT(hrtimer != NULL); - /* Enter critical section to protect the hrtimer container */ + /* Acquire the lock and seize the ownership of the hrtimer queue. */ flags = write_seqlock_irqsave(&g_hrtimer_lock); @@ -107,7 +107,7 @@ int hrtimer_cancel(FAR hrtimer_t *hrtimer) } } - /* Leave critical section */ + /* Release the lock and give up the ownership of the hrtimer queue. */ write_sequnlock_irqrestore(&g_hrtimer_lock, flags); return ret; diff --git a/sched/hrtimer/hrtimer_process.c b/sched/hrtimer/hrtimer_process.c index d29a1240614..2b701cd85ae 100644 --- a/sched/hrtimer/hrtimer_process.c +++ b/sched/hrtimer/hrtimer_process.c @@ -77,7 +77,7 @@ void hrtimer_process(uint64_t now) uint64_t period; int cpu = this_cpu(); - /* Lock the hrtimer container to protect access */ + /* Acquire the lock and seize the ownership of the hrtimer queue. */ flags = write_seqlock_irqsave(&g_hrtimer_lock); @@ -102,7 +102,7 @@ void hrtimer_process(uint64_t now) break; } - /* Remove the expired timer from the timer container */ + /* Remove the expired timer from the timer queue */ hrtimer_remove(hrtimer); @@ -121,8 +121,8 @@ void hrtimer_process(uint64_t now) flags = write_seqlock_irqsave(&g_hrtimer_lock); /* If the timer is periodic and has not been rearmed or - * cancelled concurrently, - * compute next expiration and reinsert into container + * cancelled concurrently, calculate next expiration and + * re-insert into the timer queue. */ if (period != 0u && hrtimer_is_running(hrtimer, cpu)) @@ -153,7 +153,7 @@ void hrtimer_process(uint64_t now) hrtimer_reprogram(hrtimer->expired); } - /* Leave critical section */ + /* Release the lock and give up the ownership of the hrtimer queue. */ write_sequnlock_irqrestore(&g_hrtimer_lock, flags); } diff --git a/sched/hrtimer/hrtimer_start.c b/sched/hrtimer/hrtimer_start.c index 3f6b9e09118..8d26a9fafed 100644 --- a/sched/hrtimer/hrtimer_start.c +++ b/sched/hrtimer/hrtimer_start.c @@ -82,7 +82,7 @@ int hrtimer_start(FAR hrtimer_t *hrtimer, hrtimer_entry_t func, DEBUGASSERT(hrtimer != NULL); - /* Protect container manipulation with spinlock and disable interrupts */ + /* Acquire the lock and seize the ownership of the hrtimer queue. */ flags = write_seqlock_irqsave(&g_hrtimer_lock); @@ -98,7 +98,7 @@ int hrtimer_start(FAR hrtimer_t *hrtimer, hrtimer_entry_t func, hrtimer->func = func; hrtimer->expired = next_expired; - /* Insert the timer into the container */ + /* Insert the timer into the hrtimer queue. */ hrtimer_insert(hrtimer); @@ -109,7 +109,7 @@ int hrtimer_start(FAR hrtimer_t *hrtimer, hrtimer_entry_t func, hrtimer_reprogram(hrtimer->expired); } - /* Release spinlock and restore interrupts */ + /* Release the lock and give up the ownership of the hrtimer queue. */ write_sequnlock_irqrestore(&g_hrtimer_lock, flags);
