mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Use dlist/dclist instead of PROC_QUEUE / SHM_QUEUE for heavyweight locks
Part of a series to remove SHM_QUEUE. ilist.h style lists are more widely used and have an easier to use interface. As PROC_QUEUE is now unused, remove it. Reviewed-by: Thomas Munro <thomas.munro@gmail.com> (in an older version) Discussion: https://postgr.es/m/20221120055930.t6kl3tyivzhlrzu2@awork3.anarazel.de Discussion: https://postgr.es/m/20200211042229.msv23badgqljrdg2@alap3.anarazel.de
This commit is contained in:
@@ -461,7 +461,7 @@ MarkAsPreparingGuts(GlobalTransaction gxact, TransactionId xid, const char *gid,
|
||||
/* Initialize the PGPROC entry */
|
||||
MemSet(proc, 0, sizeof(PGPROC));
|
||||
proc->pgprocno = gxact->pgprocno;
|
||||
SHMQueueElemInit(&(proc->links));
|
||||
dlist_node_init(&proc->links);
|
||||
proc->waitStatus = PROC_WAIT_STATUS_OK;
|
||||
if (LocalTransactionIdIsValid(MyProc->lxid))
|
||||
{
|
||||
@@ -491,7 +491,7 @@ MarkAsPreparingGuts(GlobalTransaction gxact, TransactionId xid, const char *gid,
|
||||
proc->waitProcLock = NULL;
|
||||
pg_atomic_init_u64(&proc->waitStart, 0);
|
||||
for (i = 0; i < NUM_LOCK_PARTITIONS; i++)
|
||||
SHMQueueInit(&(proc->myProcLocks[i]));
|
||||
dlist_init(&proc->myProcLocks[i]);
|
||||
/* subxid data must be filled later by GXactLoadSubxactData */
|
||||
proc->subxidStatus.overflowed = false;
|
||||
proc->subxidStatus.count = 0;
|
||||
|
||||
Reference in New Issue
Block a user