Skip to content

Commit 9adaf64

Browse files
committed
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.
1 parent caf6e9d commit 9adaf64

File tree

6 files changed

+100
-83
lines changed

6 files changed

+100
-83
lines changed

doc/src/sgml/installation.sgml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.189 2003/12/13 23:59:06 neilc Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.190 2003/12/23 18:13:17 tgl Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -1762,8 +1762,7 @@ kill `cat /usr/local/pgsql/data/postmaster.pid`
17621762
Peter Eisentraut (<email>peter_e@gmx.net</email>)</entry>
17631763
<entry>
17641764
needs new <filename>config.guess</filename>,
1765-
<option>--disable-spinlocks</option>, <literal>#undef
1766-
HAS_TEST_AND_SET</>, disable <function>tas_dummy()</>
1765+
<option>--disable-spinlocks</option>
17671766
</entry>
17681767
</row>
17691768
<row>

src/backend/storage/lmgr/s_lock.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.20 2003/12/23 03:31:30 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.21 2003/12/23 18:13:17 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616
#include "postgres.h"
1717

1818
#include <sys/time.h>
1919
#include <unistd.h>
20+
2021
#include "storage/s_lock.h"
2122

2223

@@ -118,8 +119,8 @@ s_lock(volatile slock_t *lock, const char *file, int line)
118119
* definition exists (yet).
119120
* In the future, get rid of tas.[cso] and fold it into this file.
120121
*
121-
* If you change something here, you have to modify s_lock.h because
122-
* the definitions for these is split between this file and s_lock.h.
122+
* If you change something here, you will likely need to modify s_lock.h too,
123+
* because the definitions for these are split between this file and s_lock.h.
123124
*/
124125

125126

src/backend/storage/lmgr/spin.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*
1818
* IDENTIFICATION
19-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.13 2003/12/23 03:31:30 momjian Exp $
19+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/spin.c,v 1.14 2003/12/23 18:13:17 tgl Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -25,10 +25,9 @@
2525
#include "storage/lwlock.h"
2626
#include "storage/pg_sema.h"
2727
#include "storage/spin.h"
28-
#include "storage/s_lock.h"
2928

3029

31-
#ifdef HAS_TEST_AND_SET
30+
#ifdef HAVE_SPINLOCKS
3231

3332
/*
3433
* Report number of semaphores needed to support spinlocks.
@@ -39,7 +38,7 @@ SpinlockSemas(void)
3938
return 0;
4039
}
4140

42-
#else /* !HAS_TEST_AND_SET */
41+
#else /* !HAVE_SPINLOCKS */
4342

4443
/*
4544
* No TAS, so spinlocks are implemented as PGSemaphores.
@@ -93,4 +92,4 @@ tas_sema(volatile slock_t *lock)
9392
return !PGSemaphoreTryLock((PGSemaphore) lock);
9493
}
9594

96-
#endif /* !HAS_TEST_AND_SET */
95+
#endif /* !HAVE_SPINLOCKS */

src/include/port/univel.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define HAS_TEST_AND_SET
2-
31
/***************************************
42
* Define this if you are compiling with
53
* the native UNIXWARE C compiler.
@@ -17,5 +15,4 @@
1715
#endif
1816
#ifndef BYTE_ORDER
1917
#define BYTE_ORDER LITTLE_ENDIAN
20-
2118
#endif

src/include/port/unixware.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define HAS_TEST_AND_SET
2-
31
/* see src/backend/libpq/pqcomm.c */
42
#define SCO_ACCEPT_BUG
53

@@ -20,5 +18,4 @@
2018
#endif
2119
#ifndef BYTE_ORDER
2220
#define BYTE_ORDER LITTLE_ENDIAN
23-
2421
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy