Commit 9adaf64d authored by Tom Lane's avatar Tom Lane

Mop-up for HAS_TEST_AND_SET refactoring. Un-break two or three platforms

that were broken, try to make layout of s_lock.h entries consistent,
use HAVE_SPINLOCKS in preference to HAS_TEST_AND_SET everywhere outside
s_lock.h itself.
parent caf6e9d2
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.189 2003/12/13 23:59:06 neilc Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.190 2003/12/23 18:13:17 tgl Exp $ -->
<chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]>
......@@ -1762,8 +1762,7 @@ kill `cat /usr/local/pgsql/data/postmaster.pid`
Peter Eisentraut (<email>peter_e@gmx.net</email>)</entry>
<entry>
needs new <filename>config.guess</filename>,
<option>--disable-spinlocks</option>, <literal>#undef
HAS_TEST_AND_SET</>, disable <function>tas_dummy()</>
<option>--disable-spinlocks</option>
</entry>
</row>
<row>
......
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.20 2003/12/23 03:31:30 momjian Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.21 2003/12/23 18:13:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -17,6 +17,7 @@
#include <sys/time.h>
#include <unistd.h>
#include "storage/s_lock.h"
......@@ -118,8 +119,8 @@ s_lock(volatile slock_t *lock, const char *file, int line)
* definition exists (yet).
* In the future, get rid of tas.[cso] and fold it into this file.
*
* If you change something here, you have to modify s_lock.h because
* the definitions for these is split between this file and s_lock.h.
* If you change something here, you will likely need to modify s_lock.h too,
* because the definitions for these are split between this file and s_lock.h.
*/
......
......@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.13 2003/12/23 03:31:30 momjian Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.14 2003/12/23 18:13:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -25,10 +25,9 @@
#include "storage/lwlock.h"
#include "storage/pg_sema.h"
#include "storage/spin.h"
#include "storage/s_lock.h"
#ifdef HAS_TEST_AND_SET
#ifdef HAVE_SPINLOCKS
/*
* Report number of semaphores needed to support spinlocks.
......@@ -39,7 +38,7 @@ SpinlockSemas(void)
return 0;
}
#else /* !HAS_TEST_AND_SET */
#else /* !HAVE_SPINLOCKS */
/*
* No TAS, so spinlocks are implemented as PGSemaphores.
......@@ -93,4 +92,4 @@ tas_sema(volatile slock_t *lock)
return !PGSemaphoreTryLock((PGSemaphore) lock);
}
#endif /* !HAS_TEST_AND_SET */
#endif /* !HAVE_SPINLOCKS */
#define HAS_TEST_AND_SET
/***************************************
* Define this if you are compiling with
* the native UNIXWARE C compiler.
......@@ -17,5 +15,4 @@
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#define HAS_TEST_AND_SET
/* see src/backend/libpq/pqcomm.c */
#define SCO_ACCEPT_BUG
......@@ -20,5 +18,4 @@
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment