anchao commented on code in PR #18049:
URL: https://github.com/apache/nuttx/pull/18049#discussion_r2716108787


##########
include/nuttx/spinlock.h:
##########
@@ -548,14 +568,22 @@ irqstate_t spin_lock_irqsave_nopreempt(FAR volatile 
spinlock_t *lock)
  *
  ****************************************************************************/
 
+#ifdef CONFIG_SPINLOCK
 static inline_function
-irqstate_t rspin_lock_irqsave(FAR rspinlock_t *lock)
+void rspin_lock(FAR rspinlock_t *lock)
 {
   rspinlock_t new_val;
   rspinlock_t old_val = RSPINLOCK_INITIALIZER;
-  irqstate_t  flags   = up_irq_save();
   int         cpu     = this_cpu() + 1;
 
+  /* Already owned this lock. */
+
+  if (lock->owner == cpu)

Review Comment:
   and this PR also has a critical bug — the owner isn't restored in 
rspin_unlock().



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to