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 2022/11/22 07:38:22 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7649: libc: Move the common implementation of up_testset to libc/machine

pkarashchenko commented on code in PR #7649:
URL: https://github.com/apache/incubator-nuttx/pull/7649#discussion_r1028964692


##########
libs/libc/machine/arch_atomic.c:
##########
@@ -733,3 +733,26 @@ SYNC_VAL_CMP_SWAP(4, uint32_t)
 SYNC_VAL_CMP_SWAP(8, uint64_t)
 
 #endif /* __clang__ */
+
+/****************************************************************************
+ * Name: up_testset
+ ****************************************************************************/
+
+#if defined(CONFIG_SPINLOCK) && !defined(CONFIG_ARCH_HAVE_TESTSET)
+spinlock_t up_testset(volatile FAR spinlock_t *lock)
+{
+  irqstate_t flags;
+  spinlock_t ret;
+
+  flags = spin_lock_irqsave(NULL);

Review Comment:
   @xiaoxiang781216 are you sure in this change? The first look makes me thinking that change from `up_irq_save` to `spin_lock_irqsave` will make a recursion.



-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org