---------------------------------------------------------------- * ExecAppendInitializeDSM * * Set up shared state for Parallel Append. * ---------------------------------------------------------------- */
| 518 | * ---------------------------------------------------------------- |
| 519 | */ |
| 520 | void |
| 521 | ExecAppendInitializeDSM(AppendState *node, |
| 522 | ParallelContext *pcxt) |
| 523 | { |
| 524 | ParallelAppendState *pstate; |
| 525 | |
| 526 | pstate = shm_toc_allocate(pcxt->toc, node->pstate_len); |
| 527 | memset(pstate, 0, node->pstate_len); |
| 528 | LWLockInitialize(&pstate->pa_lock, LWTRANCHE_PARALLEL_APPEND); |
| 529 | shm_toc_insert(pcxt->toc, node->ps.plan->plan_node_id, pstate); |
| 530 | |
| 531 | node->as_pstate = pstate; |
| 532 | node->choose_next_subplan = choose_next_subplan_for_leader; |
| 533 | } |
| 534 | |
| 535 | |
| 536 | /* ---------------------------------------------------------------- |
no test coverage detected