aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-08-28 18:26:07 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-08-28 18:26:07 +0000
commit9f70dce4cef73a8dce009428f787d9c339c5c10e (patch)
tree4264f3fdbded68196337114c815dc145c1935ee0
parent5677c28c9147445de1fb942b614814f7064fff7f (diff)
downloadpostgresql-9f70dce4cef73a8dce009428f787d9c339c5c10e.tar.gz
postgresql-9f70dce4cef73a8dce009428f787d9c339c5c10e.zip
Add a SYNC instruction to the S_UNLOCK sequence for MIPS.
-rw-r--r--src/include/storage/s_lock.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 39410c211b6..6b753bd3c66 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -66,7 +66,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.133.4.3 2005/08/27 16:22:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.133.4.4 2005/08/28 18:26:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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 */