File postgresql-tas-aarch64.patch of Package postgresql92.openSUSE_13.1_Update

Index: src/include/storage/s_lock.h
===================================================================
--- src/include/storage/s_lock.h.orig
+++ src/include/storage/s_lock.h
@@ -689,6 +689,23 @@ typedef unsigned char slock_t;
 #endif
 
 
+#if defined(__aarch64__)
+#define HAS_TEST_AND_SET
+
+#define TAS(lock) tas(lock)
+
+typedef int slock_t;
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+	return __sync_lock_test_and_set(lock, 1);
+}
+
+#define S_UNLOCK(lock) __sync_lock_release(lock)
+
+#endif /* __aarch64__ */
+
 #endif	/* defined(__GNUC__) || defined(__INTEL_COMPILER) */
 
 
openSUSE Build Service is sponsored by