We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76eeb02 commit 08c5844Copy full SHA for 08c5844
1 file changed
src/include/storage/s_lock.h
@@ -625,6 +625,24 @@ tas(volatile slock_t *lock)
625
626
#endif /* __vax__ */
627
628
+#if defined(__loongarch__)
629
+#ifdef HAVE_GCC__SYNC_INT32_TAS
630
+#define HAS_TEST_AND_SET
631
+
632
+#define TAS(lock) tas(lock)
633
634
+typedef int slock_t;
635
636
+static __inline__ int
637
+tas(volatile slock_t *lock)
638
+{
639
+ return __sync_lock_test_and_set(lock, 1);
640
+}
641
642
+#define S_UNLOCK(lock) __sync_lock_release(lock)
643
644
+#endif /* HAVE_GCC__SYNC_INT32_TAS */
645
+#endif /* __loongarch__ */
646
647
#if defined(__mips__) && !defined(__sgi) /* non-SGI MIPS */
648
#define HAS_TEST_AND_SET
0 commit comments