hujun260 commented on code in PR #14578:
URL: https://github.com/apache/nuttx/pull/14578#discussion_r1853192909


##########
include/nuttx/spinlock.h:
##########
@@ -528,22 +567,29 @@ static inline_function
 irqstate_t spin_lock_irqsave_wo_note(FAR volatile spinlock_t *lock)
 {
   irqstate_t ret;
-  ret = up_irq_save();
+  int me;
 
   if (NULL == lock)

Review Comment:
   ok
   



##########
include/nuttx/spinlock.h:
##########
@@ -515,6 +515,45 @@ static inline_function void spin_unlock(FAR volatile 
spinlock_t *lock)
 
 #define spin_initialize(l,s) do { SP_DMB(); *(l) = (s); } while (0)
 
+/****************************************************************************
+ * Name: spin_trylock_irqsave_wo_note
+ *
+ * Description:
+ *   Try once to lock the spinlock.  Do not wait if the spinlock is already
+ *   locked.
+ *
+ *   This implementation is the same as the above spin_trylock() except that
+ *   it does not perform instrumentation logic.
+ *
+ * Input Parameters:
+ *   lock  - A reference to the spinlock object to lock.
+ *   flags - flag of interrupts status
+ *
+ * Returned Value:
+ *   SP_LOCKED   - Failure, the spinlock was already locked
+ *   SP_UNLOCKED - Success, the spinlock was successfully locked
+ *
+ * Assumptions:
+ *   Not running at the interrupt level.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SPINLOCK
+#  define spin_trylock_irqsave_wo_note(l, f) \
+({ \

Review Comment:
   done



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