hujun260 commented on code in PR #15136: URL: https://github.com/apache/nuttx/pull/15136#discussion_r1880217393
########## sched/clock/clock_timekeeping.c: ########## @@ -72,7 +73,7 @@ static int clock_get_current_time(FAR struct timespec *ts, time_t sec; int ret; - flags = enter_critical_section(); + flags = spin_lock_irqsave(&g_clock_lock); ret = up_timer_gettick(&counter); Review Comment: I believe there is no clear specification that requires up_timer_gettick to be called within a critical_section. Currently, there are numerous calls to up_timer_gettick that are not within a critical section. For example, clock_systime_ticks calls up_timer_gettick, but clock_systime_ticks itself is not within a critical_section in many places. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
