You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/01/29 08:27:40 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2767: sched/wqueue/notifier: protect the work notifier with critical section

xiaoxiang781216 commented on a change in pull request #2767:
URL: https://github.com/apache/incubator-nuttx/pull/2767#discussion_r566652712



##########
File path: sched/wqueue/kwork_notifier.c
##########
@@ -256,6 +250,10 @@ int work_notifier_setup(FAR struct work_notifier_s *info)
 
       memcpy(&notifier->info, info, sizeof(struct work_notifier_s));
 
+      /* Disable interrupts very briefly. */
+
+      flags = enter_critical_section();
+
       /* Generate a unique key for this notification */
 
       notifier->key = work_notifier_key();

Review comment:
       can we switch to a free running counter?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org