* ParallelSlotsAdoptConn * Assign an open connection to the slots array for reuse. * * This turns over ownership of an open connection to a slots array. The * caller should not further use or close the connection. All the connection's * parameters (user, host, port, etc.) except possibly dbname should match * those of the slots array's cparams, as given in ParallelSlotsSetup. If * these
| 429 | * these parameters differ, subsequent behavior is undefined. |
| 430 | */ |
| 431 | void |
| 432 | ParallelSlotsAdoptConn(ParallelSlotArray *sa, PGconn *conn) |
| 433 | { |
| 434 | int offset; |
| 435 | |
| 436 | offset = find_unconnected_slot(sa); |
| 437 | if (offset >= 0) |
| 438 | sa->slots[offset].connection = conn; |
| 439 | else |
| 440 | disconnectDatabase(conn); |
| 441 | } |
| 442 | |
| 443 | /* |
| 444 | * ParallelSlotsTerminate |
no test coverage detected