pussuw commented on code in PR #16486:
URL: https://github.com/apache/nuttx/pull/16486#discussion_r2128563069


##########
include/nuttx/spinlock.h:
##########
@@ -603,12 +603,17 @@ irqstate_t spin_lock_irqsave_nopreempt(FAR volatile 
spinlock_t *lock)
 static inline_function
 irqstate_t rspin_lock_irqsave_noprempt(FAR struct rspinlock_s *lock)
 {
+  /* For race condition, we may get cpuid in stack and then thread
+   * moved to other cpu.  So we have to get cpuid with irq disabled.
+   */
+
+  irqstate_t flags = up_irq_save();

Review Comment:
   Move to patch 2 (squash this patch to patch 2)



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