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

Function GetResQueueFromLock

src/backend/utils/resscheduler/resqueue.c:1101–1114  ·  view source on GitHub ↗

* GetResQueueFromLock -- find the resource queue for a given lock; * * Notes: * should be handed a locktag containing a valid queue id. * should hold the resource queue lightweight lock during this operation */

Source from the content-addressed store, hash-verified

1099 * should hold the resource queue lightweight lock during this operation
1100 */
1101ResQueue
1102GetResQueueFromLock(LOCK *lock)
1103{
1104 Assert(LWLockHeldByMe(ResQueueLock));
1105
1106 ResQueue queue = ResQueueHashFind(GET_RESOURCE_QUEUEID_FOR_LOCK(lock));
1107
1108 if (queue == NULL)
1109 {
1110 elog(ERROR, "cannot find queue id %d", GET_RESOURCE_QUEUEID_FOR_LOCK(lock));
1111 }
1112
1113 return queue;
1114}
1115
1116/*
1117 * ResGrantLock -- grant a resource lock.

Callers 5

ResLockAcquireFunction · 0.85
ResLockCheckLimitFunction · 0.85
ResLockUpdateLimitFunction · 0.85
ResCheckSelfDeadLockFunction · 0.85
DumpResQueueLockInfoFunction · 0.85

Calls 2

LWLockHeldByMeFunction · 0.85
ResQueueHashFindFunction · 0.85

Tested by

no test coverage detected