* Accumulate instrumentation, and then clean up whatever ParallelExecutorInfo * resources still exist after ExecParallelFinish. We separate these * routines because someone might want to examine the contents of the DSM * after ExecParallelFinish and before calling this routine. */
| 1178 | * after ExecParallelFinish and before calling this routine. |
| 1179 | */ |
| 1180 | void |
| 1181 | ExecParallelCleanup(ParallelExecutorInfo *pei) |
| 1182 | { |
| 1183 | /* Accumulate instrumentation, if any. */ |
| 1184 | if (pei->instrumentation) |
| 1185 | ExecParallelRetrieveInstrumentation(pei->planstate, |
| 1186 | pei->instrumentation); |
| 1187 | |
| 1188 | /* Accumulate JIT instrumentation, if any. */ |
| 1189 | if (pei->jit_instrumentation) |
| 1190 | ExecParallelRetrieveJitInstrumentation(pei->planstate, |
| 1191 | pei->jit_instrumentation); |
| 1192 | |
| 1193 | /* Free any serialized parameters. */ |
| 1194 | if (DsaPointerIsValid(pei->param_exec)) |
| 1195 | { |
| 1196 | dsa_free(pei->area, pei->param_exec); |
| 1197 | pei->param_exec = InvalidDsaPointer; |
| 1198 | } |
| 1199 | if (pei->area != NULL) |
| 1200 | { |
| 1201 | dsa_detach(pei->area); |
| 1202 | pei->area = NULL; |
| 1203 | } |
| 1204 | if (pei->pcxt != NULL) |
| 1205 | { |
| 1206 | DestroyParallelContext(pei->pcxt); |
| 1207 | pei->pcxt = NULL; |
| 1208 | } |
| 1209 | pfree(pei); |
| 1210 | } |
| 1211 | |
| 1212 | /* |
| 1213 | * Create a DestReceiver to write tuples we produce to the shm_mq designated |
no test coverage detected