aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-04-11 15:43:52 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-04-11 15:43:52 -0500
commit80647bf65a03e232c995c0826ef394dad8d685fe (patch)
tree4010561f977e3391ab3a630000ac2e390e47efde
parentd8ed83cd7fd1082f60a5b9897b62216f6b3e2587 (diff)
downloadpostgresql-80647bf65a03e232c995c0826ef394dad8d685fe.tar.gz
postgresql-80647bf65a03e232c995c0826ef394dad8d685fe.zip
Make oldSnapshotControl a pointer to a volatile structure
It was incorrectly declared as a volatile pointer to a non-volatile structure. Eliminate the OldSnapshotControl struct definition; it is really not needed. Pointed out by Tom Lane. While at it, add OldSnapshotControlData to pgindent's list of structures.
-rw-r--r--src/backend/utils/time/snapmgr.c8
-rw-r--r--src/tools/pgindent/typedefs.list1
2 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c
index 19504c35987..f18bbb980ec 100644
--- a/src/backend/utils/time/snapmgr.c
+++ b/src/backend/utils/time/snapmgr.c
@@ -117,9 +117,7 @@ typedef struct OldSnapshotControlData
TransactionId xid_by_minute[FLEXIBLE_ARRAY_MEMBER];
} OldSnapshotControlData;
-typedef struct OldSnapshotControlData *OldSnapshotControl;
-
-static volatile OldSnapshotControl oldSnapshotControl;
+static volatile OldSnapshotControlData *oldSnapshotControl;
/*
@@ -259,9 +257,9 @@ SnapMgrInit(void)
bool found;
/*
- * Create or attach to the OldSnapshotControl structure.
+ * Create or attach to the OldSnapshotControlData structure.
*/
- oldSnapshotControl = (OldSnapshotControl)
+ oldSnapshotControl = (volatile OldSnapshotControlData *)
ShmemInitStruct("OldSnapshotControlData",
SnapMgrShmemSize(), &found);
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index cdaad2089ab..794f7b10f7c 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -1175,6 +1175,7 @@ Oid
OidOptions
OkeysState
OldSerXidControl
+OldSnapshotControlData
OldToNewMapping
OldToNewMappingData
OldTriggerInfo