hujun260 commented on code in PR #18049:
URL: https://github.com/apache/nuttx/pull/18049#discussion_r2711040395
##########
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:
Yes, rspin_lock cannot be used in interrupt-enabled contexts, just like the
spin_lock function.
--
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]