xiaoxiang781216 commented on code in PR #15130:
URL: https://github.com/apache/nuttx/pull/15130#discussion_r1913526218


##########
sched/irq/irq_csection.c:
##########
@@ -285,10 +275,28 @@ irqstate_t enter_critical_section(void)
        */
 
       DEBUGASSERT(rtcb->irqcount >= 0 && rtcb->irqcount < INT16_MAX);
-      if (++rtcb->irqcount == 1)
-        {
-          /* Note that we have entered the critical section */
+      rtcb->irqcount++;
+    }
 
+  /* Return interrupt status */
+
+  return ret;
+}
+#endif
+
+#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 ||\

Review Comment:
   `#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 || \`



##########
sched/irq/irq_csection.c:
##########
@@ -440,22 +436,35 @@ void leave_critical_section(irqstate_t flags)
        */
 
       DEBUGASSERT(rtcb->irqcount > 0);
-      if (--rtcb->irqcount <= 0)
-        {
-          /* Note that we have left the critical section */
+      --rtcb->irqcount;
+    }
 
-#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0
-          nxsched_critmon_csection(rtcb, false, return_address(0));
+  /* Restore the previous interrupt state. */
+
+  up_irq_restore(flags);
+}
 #endif
-#ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION
+
+#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 ||\

Review Comment:
   `#if CONFIG_SCHED_CRITMONITOR_MAXTIME_CSECTION >= 0 || \`



##########
sched/wdog/wd_cancel.c:
##########
@@ -38,6 +38,8 @@
 #include "sched/sched.h"
 #include "wdog/wdog.h"
 
+spinlock_t g_wdspinlock = SP_UNLOCKED;

Review Comment:
   why not put into sched/wdog/wd_initialize.c?



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

Reply via email to