* Take the next available chunk from the queue of chunks being worked on in * parallel. Return NULL if there are none left. Otherwise return a pointer * to the chunk, and set *shared to the DSA pointer to the chunk. */
| 3999 | * to the chunk, and set *shared to the DSA pointer to the chunk. |
| 4000 | */ |
| 4001 | static HashMemoryChunk |
| 4002 | ExecParallelHashPopChunkQueue(HashJoinTable hashtable, dsa_pointer *shared) |
| 4003 | { |
| 4004 | ParallelHashJoinState *pstate = hashtable->parallel_state; |
| 4005 | HashMemoryChunk chunk; |
| 4006 | |
| 4007 | LWLockAcquire(&pstate->lock, LW_EXCLUSIVE); |
| 4008 | if (DsaPointerIsValid(pstate->chunk_work_queue)) |
| 4009 | { |
| 4010 | *shared = pstate->chunk_work_queue; |
| 4011 | chunk = (HashMemoryChunk) |
| 4012 | dsa_get_address(hashtable->area, *shared); |
| 4013 | pstate->chunk_work_queue = chunk->next.shared; |
| 4014 | } |
| 4015 | else |
| 4016 | chunk = NULL; |
| 4017 | LWLockRelease(&pstate->lock); |
| 4018 | |
| 4019 | return chunk; |
| 4020 | } |
| 4021 | |
| 4022 | /* |
| 4023 | * Increase the space preallocated in this backend for a given inner batch by |
no test coverage detected