---------------------------------------------------------------- * ExecBitmapHeapInitializeDSM * * Set up a parallel bitmap heap scan descriptor. * ---------------------------------------------------------------- */
| 967 | * ---------------------------------------------------------------- |
| 968 | */ |
| 969 | void |
| 970 | ExecBitmapHeapInitializeDSM(BitmapHeapScanState *node, |
| 971 | ParallelContext *pcxt) |
| 972 | { |
| 973 | ParallelBitmapHeapState *pstate; |
| 974 | EState *estate = node->ss.ps.state; |
| 975 | dsa_area *dsa = node->ss.ps.state->es_query_dsa; |
| 976 | |
| 977 | /* If there's no DSA, there are no workers; initialize nothing. */ |
| 978 | if (dsa == NULL) |
| 979 | return; |
| 980 | |
| 981 | pstate = shm_toc_allocate(pcxt->toc, node->pscan_len); |
| 982 | |
| 983 | pstate->tbmiterator = 0; |
| 984 | pstate->prefetch_iterator = 0; |
| 985 | |
| 986 | /* Initialize the mutex */ |
| 987 | SpinLockInit(&pstate->mutex); |
| 988 | pstate->prefetch_pages = 0; |
| 989 | pstate->prefetch_target = 0; |
| 990 | pstate->state = BM_INITIAL; |
| 991 | |
| 992 | ConditionVariableInit(&pstate->cv); |
| 993 | SerializeSnapshot(estate->es_snapshot, pstate->phs_snapshot_data); |
| 994 | |
| 995 | shm_toc_insert(pcxt->toc, node->ss.ps.plan->plan_node_id, pstate); |
| 996 | node->pstate = pstate; |
| 997 | } |
| 998 | |
| 999 | /* ---------------------------------------------------------------- |
| 1000 | * ExecBitmapHeapReInitializeDSM |
no test coverage detected