From 220b34331f77effdb46798ddd7cca0cffc1b2858 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 8 Jan 2014 20:58:22 -0500 Subject: [PATCH] We don't need to include pg_sema.h in s_lock.h anymore. Minor improvement to commit daa7527afc2274432094ebe7ceb03aa41f916607: s_lock.h no longer has any need to mention PGSemaphoreData, so we can rip out the #include that supplies that. In a non-HAVE_SPINLOCKS build, this doesn't really buy much since we still need the #include in spin.h --- but everywhere else, this reduces #include footprint by some trifle, and helps keep the different locking facilities separate. --- src/backend/storage/lmgr/spin.c | 1 + src/include/storage/s_lock.h | 3 --- src/include/storage/spin.h | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/storage/lmgr/spin.c b/src/backend/storage/lmgr/spin.c index 3d116bc7a2..9499db115a 100644 --- a/src/backend/storage/lmgr/spin.c +++ b/src/backend/storage/lmgr/spin.c @@ -26,6 +26,7 @@ #include "miscadmin.h" #include "replication/walsender.h" #include "storage/lwlock.h" +#include "storage/pg_sema.h" #include "storage/spin.h" diff --git a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h index 2297f77280..ba4dfe12d8 100644 --- a/src/include/storage/s_lock.h +++ b/src/include/storage/s_lock.h @@ -94,11 +94,8 @@ #ifndef S_LOCK_H #define S_LOCK_H -#include "storage/pg_sema.h" - #ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */ - #if defined(__GNUC__) || defined(__INTEL_COMPILER) /************************************************************************* * All the gcc inlines diff --git a/src/include/storage/spin.h b/src/include/storage/spin.h index 2ac510db7a..7ee2fedf44 100644 --- a/src/include/storage/spin.h +++ b/src/include/storage/spin.h @@ -57,6 +57,9 @@ #define SPIN_H #include "storage/s_lock.h" +#ifndef HAVE_SPINLOCKS +#include "storage/pg_sema.h" +#endif #define SpinLockInit(lock) S_INIT_LOCK(lock) -- 2.40.0