* Push a proc to the resgroup wait queue. */
| 2442 | * Push a proc to the resgroup wait queue. |
| 2443 | */ |
| 2444 | static void |
| 2445 | groupWaitQueuePush(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. |
no test coverage detected