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/28 16:07:03 UTC

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

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



##########
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 this be moved out os the CS?
   
   https://github.com/apache/incubator-nuttx/blob/cdd111a1faec9b40b707797e00c4afae4956fb3f/sched/wqueue/kwork_notifier.c#L146
   Has a loop. 
   
   How long are interrupts off?




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