mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Remove superfluous 'pgprocno' field from PGPROC
It was always just the index of the PGPROC entry from the beginning of the proc array. Introduce a macro to compute it from the pointer instead. Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/8171f1aa-496f-46a6-afc3-c46fe7a9b407@iki.fi
This commit is contained in:
@@ -425,6 +425,7 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
|
||||
{
|
||||
volatile PROC_HDR *procglobal = ProcGlobal;
|
||||
PGPROC *proc = MyProc;
|
||||
int pgprocno = MyProcNumber;
|
||||
uint32 nextidx;
|
||||
uint32 wakeidx;
|
||||
|
||||
@@ -458,7 +459,7 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
|
||||
* less efficiently.
|
||||
*/
|
||||
if (nextidx != INVALID_PGPROCNO &&
|
||||
ProcGlobal->allProcs[nextidx].clogGroupMemberPage != proc->clogGroupMemberPage)
|
||||
GetPGProcByNumber(nextidx)->clogGroupMemberPage != proc->clogGroupMemberPage)
|
||||
{
|
||||
/*
|
||||
* Ensure that this proc is not a member of any clog group that
|
||||
@@ -473,7 +474,7 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
|
||||
|
||||
if (pg_atomic_compare_exchange_u32(&procglobal->clogGroupFirst,
|
||||
&nextidx,
|
||||
(uint32) proc->pgprocno))
|
||||
(uint32) pgprocno))
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user