mirror of
https://github.com/apache/nuttx.git
synced 2026-10-24 07:18:45 +00:00
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 wangchengdong@lixiang.com
This commit is contained in:
parent
e6c982892b
commit
a49a5fd27f
1 changed files with 2 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue