This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit a49a5fd27f180585d3e0066a1f72fa44225afcc6 Author: wangchengdong <[email protected]> AuthorDate: Thu Oct 30 19:42:06 2025 +0800 sched/clock: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt Replace the spinlock/sched_lock pair in the sched clock module with spin_lock_irqsave_nopreempt() to improve code clarity and consistency. Signed-off-by: Chengdong Wang [email protected] --- sched/clock/clock_adjtime.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sched/clock/clock_adjtime.c b/sched/clock/clock_adjtime.c index c7028f4fd83..a46924b7033 100644 --- a/sched/clock/clock_adjtime.c +++ b/sched/clock/clock_adjtime.c @@ -115,8 +115,7 @@ static int adjtime_start(long long adjust_usec) ppb = -ppb_limit; } - flags = spin_lock_irqsave(&g_adjtime_lock); - sched_lock(); + flags = spin_lock_irqsave_nopreempt(&g_adjtime_lock); /* Set new adjustment */ @@ -142,8 +141,7 @@ static int adjtime_start(long long adjust_usec) wd_cancel(&g_adjtime_wdog); } - spin_unlock_irqrestore(&g_adjtime_lock, flags); - sched_unlock(); + spin_unlock_irqrestore_nopreempt(&g_adjtime_lock, flags); return ret; }
