anchao commented on code in PR #15129: URL: https://github.com/apache/nuttx/pull/15129#discussion_r1879370258
########## sched/sched/sched_timerexpiration.c: ########## @@ -494,19 +496,19 @@ void nxsched_timer_expiration(void) /* Get the interval associated with last expiration */ - flags = enter_critical_section(); + flags = spin_lock_irqsave_wo_note(&g_lock); up_timer_gettick(&ticks); g_timer_tick = ticks; elapsed = g_timer_interval; - leave_critical_section(flags); + spin_unlock_irqrestore_wo_note(&g_lock, flags); /* Process the timer ticks and set up the next interval (or not) */ nexttime = nxsched_timer_process(ticks, elapsed, false); - flags = enter_critical_section(); + flags = spin_lock_irqsave_wo_note(&g_lock); g_timer_interval = nxsched_timer_start(ticks, nexttime); Review Comment: `nxsched_timer_start()` will access the global variables in lower harlf driver, using local spinlock cannot guarantee the same effect as csection. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org