This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit eb2608209af54317f5cc60ea047863bb4bdb53a4
Author: hujun5 <[email protected]>
AuthorDate: Mon Jan 13 15:15:02 2025 +0800

    sched_note_wdog: add c_section
    
    reason:
    the external critical section protection has been removed.
    
    Signed-off-by: hujun5 <[email protected]>
---
 drivers/note/note_driver.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c
index 481a40d705..a6be1ca29d 100644
--- a/drivers/note/note_driver.c
+++ b/drivers/note/note_driver.c
@@ -1396,7 +1396,9 @@ void sched_note_wdog(uint8_t event, FAR void *handler, 
FAR const void *arg)
   struct note_wdog_s note;
   bool formatted = false;
   FAR struct tcb_s *tcb = this_task();
+  irqstate_t flags;
 
+  flags = enter_critical_section_wo_note();
   for (driver = g_note_drivers; *driver; driver++)
     {
       if (note_wdog(*driver, event, handler, arg))
@@ -1421,6 +1423,8 @@ void sched_note_wdog(uint8_t event, FAR void *handler, 
FAR const void *arg)
 
       note_add(*driver, &note, sizeof(note));
     }
+
+  leave_critical_section_wo_note(flags);
 }
 #endif
 

Reply via email to