MCPcopy Create free account
hub / github.com/apache/cloudberry / SHMQueueNext

Function SHMQueueNext

src/backend/storage/ipc/shmqueue.c:144–155  ·  view source on GitHub ↗

-------------------- * SHMQueueNext -- Get the next element from a queue * * To start the iteration, pass the queue head as both queue and curElem. * Returns NULL if no more elements. * * Next element is at curElem->next. If SHMQueue is part of * a larger structure, we want to return a pointer to the * whole structure rather than a pointer to its SHMQueue field. * For example, * struct

Source from the content-addressed store, hash-verified

142 *--------------------
143 */
144Pointer
145SHMQueueNext(const SHM_QUEUE *queue, const SHM_QUEUE *curElem, Size linkOffset)
146{
147 SHM_QUEUE *elemPtr = curElem->next;
148
149 Assert(ShmemAddrIsValid(curElem));
150
151 if (elemPtr == queue) /* back to the queue head? */
152 return NULL;
153
154 return (Pointer) (((char *) elemPtr) - linkOffset);
155}
156
157/*--------------------
158 * SHMQueuePrev -- Get the previous element from a queue

Callers 15

groupWaitQueueFindFunction · 0.85
resgroupDumpWaitQueueFunction · 0.85
SyncRepWakeQueueFunction · 0.85
LockCheckConflictsFunction · 0.85
LockReleaseAllFunction · 0.85
GetLockConflictsFunction · 0.85
PostPrepare_LocksFunction · 0.85
DumpLocksFunction · 0.85
CreatePredXactFunction · 0.85
FirstPredXactFunction · 0.85

Calls 1

ShmemAddrIsValidFunction · 0.85

Tested by

no test coverage detected