mirror of
https://github.com/apache/nuttx.git
synced 2026-09-01 22:53:01 +00:00
arm/sam34: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/sam34 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
3b77128e65
commit
028f4cd952
1 changed files with 3 additions and 4 deletions
|
|
@ -657,8 +657,8 @@ int sam_rtc_setalarm(const struct timespec *tp, alarmcb_t callback)
|
|||
|
||||
/* Is there already something waiting on the ALARM? */
|
||||
|
||||
flags = spin_lock_irqsave(&g_rtc_lock);
|
||||
sched_lock();
|
||||
flags = spin_lock_irqsave_nopreempt(&g_rtc_lock);
|
||||
|
||||
if (g_alarmcb == NULL)
|
||||
{
|
||||
/* No.. Save the callback function pointer */
|
||||
|
|
@ -736,8 +736,7 @@ int sam_rtc_setalarm(const struct timespec *tp, alarmcb_t callback)
|
|||
ret = OK;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&g_rtc_lock, flags);
|
||||
sched_unlock();
|
||||
spin_unlock_irqrestore_nopreempt(&g_rtc_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue