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

Function groupWaitQueuePush

src/backend/utils/resgroup/resgroup.c:2444–2465  ·  view source on GitHub ↗

* Push a proc to the resgroup wait queue. */

Source from the content-addressed store, hash-verified

2442 * Push a proc to the resgroup wait queue.
2443 */
2444static void
2445groupWaitQueuePush(ResGroupData *group, PGPROC *proc)
2446{
2447 PROC_QUEUE *waitQueue;
2448 PGPROC *headProc;
2449
2450 Assert(LWLockHeldByMeInMode(ResGroupLock, LW_EXCLUSIVE));
2451 Assert(!procIsWaiting(proc));
2452 Assert(proc->resSlot == NULL);
2453
2454 groupWaitQueueValidate(group);
2455
2456 waitQueue = &group->waitProcs;
2457 headProc = (PGPROC *) &waitQueue->links;
2458
2459 SHMQueueInsertBefore(&headProc->links, &proc->links);
2460 groupWaitProcValidate(proc, waitQueue);
2461
2462 waitQueue->size++;
2463
2464 Assert(groupWaitQueueFind(group, proc));
2465}
2466
2467/*
2468 * Pop the top proc from the resgroup wait queue and return it.

Callers 1

groupAcquireSlotFunction · 0.85

Calls 6

LWLockHeldByMeInModeFunction · 0.85
procIsWaitingFunction · 0.85
groupWaitQueueValidateFunction · 0.85
SHMQueueInsertBeforeFunction · 0.85
groupWaitProcValidateFunction · 0.85
groupWaitQueueFindFunction · 0.85

Tested by

no test coverage detected