1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

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.
This commit is contained in:
Tom Lane
2003-12-23 18:13:17 +00:00
parent caf6e9d2dd
commit 9adaf64da3
6 changed files with 103 additions and 86 deletions

View File

@@ -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.
*/

View File

@@ -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 */