]> granicus.if.org Git - postgresql/commitdiff
Make oldSnapshotControl a pointer to a volatile structure
authorKevin Grittner <kgrittn@postgresql.org>
Mon, 11 Apr 2016 20:43:52 +0000 (15:43 -0500)
committerKevin Grittner <kgrittn@postgresql.org>
Mon, 11 Apr 2016 20:43:52 +0000 (15:43 -0500)
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.

src/backend/utils/time/snapmgr.c
src/tools/pgindent/typedefs.list

index 19504c3598747db0dd121bc29e8af9c82a20738c..f18bbb980ec33b3c52fc11f8d1ebbdadd2b21219 100644 (file)
@@ -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);
 
index cdaad2089abbc0e4ba9635938125086ecf56e9d9..794f7b10f7c24042e285443d4902fca296ed3ef9 100644 (file)
@@ -1175,6 +1175,7 @@ Oid
 OidOptions
 OkeysState
 OldSerXidControl
+OldSnapshotControlData
 OldToNewMapping
 OldToNewMappingData
 OldTriggerInfo