Add a SYNC instruction to the S_UNLOCK sequence for MIPS.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 28 Aug 2005 18:26:07 +0000 (18:26 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 28 Aug 2005 18:26:07 +0000 (18:26 +0000)
src/include/storage/s_lock.h

index c7479c46a4df44b8a336a6038317bdfaa919c179..459224a96bbaf5fb3c1d49e2f42c1b323e286708 100644 (file)
@@ -472,6 +472,14 @@ tas(volatile slock_t *lock)
        return _res;
 }
 
+/* MIPS S_UNLOCK is almost standard but requires a "sync" instruction */
+#define S_UNLOCK(lock) \
+do \
+{\
+       __asm__ __volatile__ (" sync \n"); \
+       *((volatile slock_t *) (lock)) = 0; \
+} while (0)
+
 #endif /* __mips__ && !__sgi */