summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian2003-09-12 16:10:27 +0000
committerBruce Momjian2003-09-12 16:10:27 +0000
commit06e3ec7a542ede97986cbab8066b1293b1cd2751 (patch)
tree618d6bccc0f240e2d784ffb1474437104a46acc3 /src
parent69a46e9ce1f80056f5b72aaa80b29821bdf821c1 (diff)
Implement compiler #error if spinlock code not found, add configure flag
to bypass the error, --without-spinlocks.
Diffstat (limited to 'src')
-rw-r--r--src/include/pg_config.h.in3
-rw-r--r--src/include/storage/s_lock.h8
2 files changed, 9 insertions, 2 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 03874772cd0..8c04b8e6b47 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -357,6 +357,9 @@
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
+/* Define to 1 if you have spinlocks. */
+#undef HAVE_SPINLOCKS
+
/* Define to 1 if you have the `srandom' function. */
#undef HAVE_SRANDOM
diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h
index 82795180439..4d49c52c711 100644
--- a/src/include/storage/s_lock.h
+++ b/src/include/storage/s_lock.h
@@ -63,7 +63,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: s_lock.h,v 1.112 2003/08/04 02:40:15 momjian Exp $
+ * $Id: s_lock.h,v 1.113 2003/09/12 16:10:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -537,7 +537,11 @@ extern slock_t wc_tas(volatile slock_t *lock);
-#else /* !HAS_TEST_AND_SET */
+#else /* HAS_TEST_AND_SET */
+
+#ifdef HAVE_SPINLOCKS
+#error This platform does not support native spinlocks. To continue the compile, rerun configure using --without-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org.
+#endif
/*
* Fake spinlock implementation using semaphores --- slow and prone