diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/storage/procarray.h | 4 | ||||
-rw-r--r-- | src/include/utils/snapmgr.h | 23 | ||||
-rw-r--r-- | src/include/utils/snapshot.h | 5 |
3 files changed, 22 insertions, 10 deletions
diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index 160b6c9670e..ea0aa999441 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.21 2008/03/26 16:20:48 alvherre Exp $ + * $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.22 2008/05/12 20:02:02 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -26,7 +26,7 @@ extern void ProcArrayRemove(PGPROC *proc, TransactionId latestXid); extern void ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid); extern void ProcArrayClearTransaction(PGPROC *proc); -extern Snapshot GetSnapshotData(Snapshot snapshot, bool serializable); +extern Snapshot GetSnapshotData(Snapshot snapshot); extern bool TransactionIdIsInProgress(TransactionId xid); extern bool TransactionIdIsActive(TransactionId xid); diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h index c76c70feaac..8f3cc44c57b 100644 --- a/src/include/utils/snapmgr.h +++ b/src/include/utils/snapmgr.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/snapmgr.h,v 1.1 2008/03/26 18:48:59 alvherre Exp $ + * $PostgreSQL: pgsql/src/include/utils/snapmgr.h,v 1.2 2008/05/12 20:02:02 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -16,9 +16,7 @@ #include "utils/snapshot.h" -extern PGDLLIMPORT Snapshot SerializableSnapshot; -extern PGDLLIMPORT Snapshot LatestSnapshot; -extern PGDLLIMPORT Snapshot ActiveSnapshot; +extern bool FirstSnapshotSet; extern TransactionId TransactionXmin; extern TransactionId RecentXmin; @@ -26,8 +24,19 @@ extern TransactionId RecentGlobalXmin; extern Snapshot GetTransactionSnapshot(void); extern Snapshot GetLatestSnapshot(void); -extern Snapshot CopySnapshot(Snapshot snapshot); -extern void FreeSnapshot(Snapshot snapshot); -extern void FreeXactSnapshot(void); +extern void SnapshotSetCommandId(CommandId curcid); + +extern void PushActiveSnapshot(Snapshot snapshot); +extern void PushUpdatedSnapshot(Snapshot snapshot); +extern void PopActiveSnapshot(void); +extern Snapshot GetActiveSnapshot(void); +extern bool ActiveSnapshotSet(void); + +extern Snapshot RegisterSnapshot(Snapshot snapshot); +extern void UnregisterSnapshot(Snapshot snapshot); + +extern void AtSubCommit_Snapshot(int level); +extern void AtSubAbort_Snapshot(int level); +extern void AtEOXact_Snapshot(bool isCommit); #endif /* SNAPMGR_H */ diff --git a/src/include/utils/snapshot.h b/src/include/utils/snapshot.h index 20d971a102a..52f9dd677a2 100644 --- a/src/include/utils/snapshot.h +++ b/src/include/utils/snapshot.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/snapshot.h,v 1.2 2008/03/26 21:10:39 alvherre Exp $ + * $PostgreSQL: pgsql/src/include/utils/snapshot.h,v 1.3 2008/05/12 20:02:02 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -57,6 +57,9 @@ typedef struct SnapshotData * out any that are >= xmax */ CommandId curcid; /* in my xact, CID < curcid are visible */ + uint32 active_count; /* refcount on ActiveSnapshot stack */ + uint32 regd_count; /* refcount on RegisteredSnapshotList */ + bool copied; /* false if it's a static snapshot */ } SnapshotData; /* |