mirror of
https://github.com/postgres/postgres.git
synced 2025-11-16 15:02:33 +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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user