From: Tom Lane Date: Thu, 9 Jan 2014 01:58:22 +0000 (-0500) Subject: We don't need to include pg_sema.h in s_lock.h anymore. X-Git-Tag: REL9_4_BETA1~716 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=220b34331f77effdb46798ddd7cca0cffc1b2858;p=postgresql 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. --- 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)