anchao commented on code in PR #15324:
URL: https://github.com/apache/nuttx/pull/15324#discussion_r1898506587
##########
sched/clock/clock_systime_timespec.c:
##########
@@ -62,21 +62,21 @@
int clock_systime_timespec(FAR struct timespec *ts)
{
#ifdef CONFIG_RTC_HIRES
+ irqstate_t flags;
+
+ flags = spin_lock_irqsave(&g_basetime_lock);
if (g_rtc_enabled)
{
- irqstate_t flags;
-
up_rtc_gettime(ts);
Review Comment:
I just only one opinion "We can't let the performance get worse after any
change" right?
spin_lock_irqsave(NULL) ->
spin_lock_irqsave(lock) + enter_critical_section()
up_rtc_gettime() is called very frequently. If the timer driver needs
enter_critical_section() protection, it means that the spinlock global lock is
not really removed yet.
--
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]