1 /*-------------------------------------------------------------------------
4 * POSTGRES process array definitions.
7 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
12 *-------------------------------------------------------------------------
17 #include "storage/lock.h"
18 #include "utils/snapshot.h"
21 extern Size
ProcArrayShmemSize(void);
22 extern void CreateSharedProcArray(void);
23 extern void ProcArrayAdd(PGPROC
*proc
);
24 extern void ProcArrayRemove(PGPROC
*proc
, TransactionId latestXid
);
26 extern void ProcArrayEndTransaction(PGPROC
*proc
, TransactionId latestXid
);
27 extern void ProcArrayClearTransaction(PGPROC
*proc
);
29 extern Snapshot
GetSnapshotData(Snapshot snapshot
);
31 extern bool TransactionIdIsInProgress(TransactionId xid
);
32 extern bool TransactionIdIsActive(TransactionId xid
);
33 extern TransactionId
GetOldestXmin(bool allDbs
, bool ignoreVacuum
);
35 extern int GetTransactionsInCommit(TransactionId
**xids_p
);
36 extern bool HaveTransactionsInCommit(TransactionId
*xids
, int nxids
);
38 extern PGPROC
*BackendPidGetProc(int pid
);
39 extern int BackendXidGetPid(TransactionId xid
);
40 extern bool IsBackendPid(int pid
);
42 extern VirtualTransactionId
*GetCurrentVirtualXIDs(TransactionId limitXmin
,
43 bool allDbs
, int excludeVacuum
);
44 extern int CountActiveBackends(void);
45 extern int CountDBBackends(Oid databaseid
);
46 extern int CountUserBackends(Oid roleid
);
47 extern bool CountOtherDBBackends(Oid databaseId
,
48 int *nbackends
, int *nprepared
);
50 extern void XidCacheRemoveRunningXids(TransactionId xid
,
51 int nxids
, const TransactionId
*xids
,
52 TransactionId latestXid
);
54 #endif /* PROCARRAY_H */