hujun260 commented on code in PR #15129:
URL: https://github.com/apache/nuttx/pull/15129#discussion_r1912697122


##########
sched/sched/sched_timerexpiration.c:
##########
@@ -439,22 +462,18 @@ void nxsched_alarm_tick_expiration(clock_t ticks)
 {
   clock_t elapsed;
   clock_t nexttime;
-  irqstate_t flags;
 
   /* Save the time that the alarm occurred */
 
-  flags = enter_critical_section();
-  elapsed = ticks - g_timer_tick;
-  g_timer_tick = ticks;
-  leave_critical_section(flags);
+  elapsed = ticks - get_g_time_tick();

Review Comment:
   done



##########
sched/sched/sched_timerexpiration.c:
##########
@@ -106,6 +106,24 @@ static unsigned int g_timer_interval;
  * Private Functions
  ****************************************************************************/
 
+static inline_function void set_g_time_tick(clock_t tick)

Review Comment:
   done



##########
sched/sched/sched_timerexpiration.c:
##########
@@ -106,6 +106,24 @@ static unsigned int g_timer_interval;
  * Private Functions
  ****************************************************************************/
 
+static inline_function void set_g_time_tick(clock_t tick)
+{
+#ifdef CONFIG_SYSTEM_TIME64
+  atomic64_set((FAR atomic64_t *)&g_timer_tick, tick);
+#else
+  atomic_set((FAR atomic_t *)&g_timer_tick, tick);
+#endif
+}
+
+static inline_function clock_t get_g_time_tick(void)

Review Comment:
   done



-- 
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]

Reply via email to